Skip to main content

Combines plotnine and dppd

Project description

dppd_plotnine

Build status: Build Status
Documentation https://dppd_plotnine.readthedocs.io/en/latest/

dppd_plotnine combines the power of plotnine and dppd

It allows you to use code like this

   import numpy as np
   from dppd import dppd
   import dppd_plotnine
   from plotnine.data import mtcars
   import plotnine as p9
   dp, X = dppd()

   plot = (
      dp(mtcars)
      .assign(kwh=X.hp * 0.74)
      .categorize("cyl")
      .p9()
      .add_point(
            "cyl",
            "kwh",
            color="cyl",
            position=p9.position_jitter(height=0, random_state=500),
      )
      .add_errorbar(
            x="cyl",
            y="kwh_median",
            ymin="kwh_median",
            ymax="kwh_median",
            data=dp(X.data)
            .groupby("cyl")
            .summarize(("kwh", np.median, "kwh_median"))
            .pd,
      )
      .scale_color_manual(
            ["red", "blue", "purple"]
      )  # after pd, X is what it was before
      .pd
    )
    plot.save("test.png")
    

Example image

Please see our full documentation at https://dppd_plotnine.readthedocs.io/en/latest/ for more details of the straight and enhanced plotnine mappings available.

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

dppd_plotnine-0.2.7.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file dppd_plotnine-0.2.7.tar.gz.

File metadata

  • Download URL: dppd_plotnine-0.2.7.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dppd_plotnine-0.2.7.tar.gz
Algorithm Hash digest
SHA256 2a9a8dfac44ae42350727eb14c083a32ce47275e15510c10a29617728f1bc830
MD5 b73f46c9b5afa632105ae5dd1342c9ec
BLAKE2b-256 19873c147effeab45d33c934cddb511ed570163ebb951e8e872e19f1dd7b3a5c

See more details on using hashes here.

Supported by

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