interplot
Create matplotlib and plotly charts with the same few lines of code.
It combines the best of the matplotlib and the plotly worlds through a unified, flat API.
Switch between matplotlib and plotly with the single keyword interactive. All the necessary boilerplate code to translate between the packages is contained in this module.
Currently supported building blocks:
- scatter plots
linescatterlinescatter
- bar charts
bar - histogram
hist - boxplot
boxplot - heatmap
heatmap - linear regression
regression - line and area fill
fill - horizontal and vertical lines
hlinevline
- annotations
text
Supported
- 2D subplots
- automatic color cycling
- 3 different API modes
-
One line of code
>>> interplot.line([0,4,6,7], [1,2,4,8]) [plotly line figure] >>> interplot.hist(np.random.normal(40, 8, 1000), interactive=False) [matplotlib hist figure] >>> interplot.boxplot( ... [ ... np.random.normal(20, 5, 1000), ... np.random.normal(40, 8, 1000), ... np.random.normal(60, 5, 1000), ... ], ... ) [plotly boxplots]
-
Decorator to auto-initialize plots to use in your methods
>>> @interplot.magic_plot ... def plot_my_data(fig=None): ... # import and process your data... ... data = np.random.normal(2, 3, 1000) ... # draw with the fig instance obtained from the decorator function ... fig.add_line(data, label="my data") ... fig.add_fill((0, 999), (-1, -1), (5, 5), label="sigma") >>> plot_my_data(title="My Recording") [plotly figure "My Recording"] >>> @interplot.magic_plot_preset(interactive=False, title="Preset Title") >>> def plot_my_data_preconfigured(fig=None): ... # import and process your data... ... data = np.random.normal(2, 3, 1000) ... # draw with the fig instance obtained from the decorator function ... fig.add_line(data, label="my data") ... fig.add_fill((0, 999), (-1, -1), (5, 5), label="sigma") >>> plot_my_data_preconfigured() [matplotlib figure "Preset Title"]
-
The
interplot.Plotclass for full control>>> fig = interplot.Plot( ... interactive=True, ... title="Everything Under Control", ... fig_size=(800, 500), ... rows=1, ... cols=2, ... shared_yaxes=True, ... # ... ... ) >>> fig.add_hist(np.random.normal(1, 0.5, 1000), row=0, col=0) >>> fig.add_boxplot( ... [ ... np.random.normal(20, 5, 1000), ... np.random.normal(40, 8, 1000), ... np.random.normal(60, 5, 1000), ... ], ... row=0, ... col=1, ... ) ... # ... >>> fig.post_process() >>> fig.show() [plotly figure "Everything Under Control"] >>> fig.save("export/path/file.html") saved figure at export/path/file.html
-
Resources
- Documentation: https://interplot.janjo.ch
- Demo Notebooks: https://nbviewer.org/github/janjoch/interplot/tree/main/demo/
- Source Code: https://github.com/janjoch/interplot
- PyPI: https://pypi.org/project/interplot/
Licence
Demo
Install
pip install interplot
install development branch
pip install git+https://github.com/janjoch/interplot.git@development
active development installation
git clone https://github.com/janjoch/interplotcd interplotpip install -e .
Contribute
Ideas, bug reports/fixes, feature requests and code submissions are very welcome! Please write to janjo@duck.com or directly into a pull request.
Metadata
Release files for interplot 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| interplot-1.2.0.tar.gz | 52.8 kB | Without provenance | Details for interplot-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| interplot-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for interplot-1.2.0-py3-none-any.whl |
Total release size: 104.8 kB
Release files / interplot-1.2.0.tar.gz
| Download URL | interplot-1.2.0.tar.gz |
|---|---|
| Size | 52.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1e56e8d36f93a3cb4f54946da2596ebaeb37d65d153f91d9b0f5a918b595720
|
|
BLAKE2b-256 checksum How to use checksums |
34e92f33efa8ea7bd96b98b2121e070b16e804ee159a08d9da51f5f4204a6574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / interplot-1.2.0-py3-none-any.whl
| Download URL | interplot-1.2.0-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9b02ebf5ed2fff564924e22e05b086c7f4d29fa5a7436c922e01c5033da346f
|
|
BLAKE2b-256 checksum How to use checksums |
6b650d054a7baff63639c0a48250f82e05f20bedb0ceb1bc2a7de2b5204f6e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for interplot 1.2.0
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.