Functions for creating HTML objects out of Matplotlib plots in Jupyter
Project description
html_plot
This package can be used to render Matplotlib plots as HTML objects in Jupyter, so that they can be placed in HTML tables, downloaded on click, and more.
Examples
import pandas as pd
my_plot = pd.DataFrame([[1,2,3],[4,5,6]]).plot()
Simple usage
html_plot.display(my_plot)
Advanced usage
Adjust Figure and Axes (e.g. figsize, title)
plot_dim = html_plot.get_dim(my_plot.get_figure())
plot_dim.figsize *= 1.5
ax = html_plot.ax("This is my plot", **plot_dim)
my_html_plot = pd.DataFrame([[1,2,3],[4,5,6]]).plot(ax=ax)
Output HTML string
html_str = html_plot.html_str(my_html_plot)
print(html_str)
Output an IPython.display.HTML
object
import IPython.display
html_obj = html_plot.HTML(my_html_plot)
IPython.display.display(html_obj)
Display the object using a wrapper for IPython.display.display()
html_plot.display(my_html_plot)
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
html_plot-0.1.0.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for html_plot-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d968fce80665a897cb4e0c6ab59820587f8352a97a330ab177730b2122c9955c |
|
MD5 | fb4de2b4d2d5a1bfd130a4d821ebb2ff |
|
BLAKE2b-256 | 2ceb95b75de64bce939c41ae48f6498a6988542db8942608b5eb06b302459050 |