Skip to main content

Prism themes for plotnine, inspired by ggprism

Project description

plotnine-prism

Prism themes for plotnine, inspired by ggprism.

Installation

pip install -U plotnine-prism

Documentation

https://pwwang.github.io/plotnine-prism

Usage

See this notebook for the following example, and also Getting started for a quick overview of plotnine_prism features.

from plotnine import *
from plotnine_prism import *

from datar.all import f, as_categorical, mutate
from datar.datasets import ToothGrowth

ToothGrowth >>= 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 for the source code and step-by-step instructions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotnine_prism-0.2.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotnine_prism-0.2.0-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file plotnine_prism-0.2.0.tar.gz.

File metadata

  • Download URL: plotnine_prism-0.2.0.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for plotnine_prism-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1298dca49344d7960c66f2bb486c5387f5c84ee823aabe0ae633c842a0e938cf
MD5 cb408352252031e35f0b26ab89eeaa1f
BLAKE2b-256 809a6d1ecf09a3d5687167a525822ca600d22dfb9c56c6192560103101b5fca8

See more details on using hashes here.

File details

Details for the file plotnine_prism-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: plotnine_prism-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for plotnine_prism-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5f119025c65af338a45af15912e4719febb4f503de342bd966694cfc480ffd
MD5 9ef9258a2b12620c2fc77ca9d524e44a
BLAKE2b-256 3d06e256b28e0fa50420cc66d28be4d617662688fdc03909a349a183b91cfc87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page