Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pwwang/plotnine-prism
Prism themes for plotnine, inspired by ggprism.
https://github.com/pwwang/plotnine-prism
Last synced: 14 days ago
JSON representation
Prism themes for plotnine, inspired by ggprism.
- Host: GitHub
- URL: https://github.com/pwwang/plotnine-prism
- Owner: pwwang
- Created: 2021-08-08T06:09:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-27T07:12:30.000Z (over 1 year ago)
- Last Synced: 2024-12-13T03:51:30.715Z (21 days ago)
- Language: Python
- Homepage: https://pwwang.github.io/plotnine-prism
- Size: 6.8 MB
- Stars: 14
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# plotnine-prism
Prism themes for [plotnine][1], inspired by [ggprism][2].
## Installation
```
pip install -U plotnine-prism
```## Documentation
[https://pwwang.github.io/plotnine-prism][3]
## Usage
See [this notebook][6] for the following example, and also [Getting started][4] for a quick overview of `plotnine_prism` features.
```python
from plotnine import *
from plotnine_prism import *from datar.all import f, as_categorical, mutate
from datar.datasets import ToothGrowthToothGrowth >>= mutate(dose=as_categorical(f.dose))
base = (
ggplot(ToothGrowth, aes(x = "dose", y = "len")) +
geom_violin(aes(colour = "dose", fill = "dose"), trim = False) +
geom_boxplot(aes(fill = "dose"), width = 0.2, colour = "black")
)p1 = base + ylim(-5, 40)
p2 = (
base +
scale_y_continuous(limits=[-5, 40], guide=guide_prism_offset_minor()) +
scale_color_prism('floral') +
scale_fill_prism('floral') +
theme_prism()
)
# See examples/nb_helpers.py for plot_grid function
# plot_grid(p1, p2)
```
## More examples
The Dose Response Curve was recreated. See [this vignette][5] for the source code and step-by-step instructions.
[1]: https://github.com/has2k1/plotnine
[2]: https://github.com/csdaw/ggprism/
[3]: https://pwwang.github.io/plotnine-prism
[4]: https://pwwang.github.io/plotnine-prism/get_started
[5]: https://pwwang.github.io/plotnine-prism/raw/ex1-dose
[6]: https://pwwang.github.io/plotnine-prism/raw/README