Skip to main content
pyggplot is a pythonic wrapper around the R ggplot2 library ( http://had.co.nz/ggplot2/ ).

Unlike the python ggplot (https://github.com/yhat/ggplot) this is not a reimplemntation
based on matplotlib, but a straigth forward 'take pandas DataFrames and shove them into R via rpy2'
approach.

Usage:
df = pandas.DataFrame({'x': numpy.uniform(size=100), 'y' = numpy.uniform(size=100), 'group' = ['A','B'] * 50})
p = pyggplot.Plot(df)
p.add_scatter('x','y', color='group')
p.render('output.png')

Takes a pandas.DataFrame object, then add layers with the various add_xyz
functions (e.g. add_scatter).

Referr to the ggplot documentation about the layers (geoms), and simply
replace geom_* with add_*.
See http://docs.ggplot2.org/0.9.3.1/index.html

You do not need to seperate aesthetics from values - the wrapper
will treat a parameter as value if and only if it is not a column name.
(so y = 0 is a value, color = 'blue 'is a value - except if you have a column
'blue', then it's a column!. And y = 'value' doesn't work, but that seems to be a ggplot issue).

When the DataFrame is passed to R:
- row indices are truned into columns with 'reset_index'
- multi level column indices are flattend by concatenating them with ' '
-> (X, 'mean) becomes 'x mean'

Error messages are not great - most of them translate to 'one or more columns were not found',
but they can appear as a lot of different actual messages such as
- argument "env" is missing, with no defalut
- object 'y' not found
- object 'dat_0' not found
- requires the follewing missing aesthetics: x
- non numeric argument to binary operator
without actually quite pointing at what is strictly the offending value.
Also, the error appears when rendering (or printing in ipython notebook),
not when adding the layer.

Open questions:
- the stat support is not great - it doesn't easily map into pythonic objects. For now, do your stats in pandas - more powerful anyhow!
- how could error messages be improved?

Metadata

Release files for pyggplot 1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyggplot 1
File Size Uploaded Provenance Actions
pyggplot-1.tar.gz 18.6 kB Without provenance Details for pyggplot-1.tar.gz

Release files / pyggplot-1.tar.gz

Download URL pyggplot-1.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3900eeb4e7071d5f03b457bf4b9e2cd9adc2dcbd2040441b3d2efdb720477610
BLAKE2b-256 checksum
How to use checksums
6cf40bb35311b36501ed65c97ebbb115080dc56fa08ddd2288fb682fb8da7599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyggplot 1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page