Python. Most of the gallery sections provide
plotly examples, this post provides a few general tips.
⏱ Quick start
Matplotlib is the most famous python data visualization library. It is widely used and most of other viz libraries (like
seaborn) are actually built on top of it.
Once installed, matplotlib must be imported, usually using
import matplotlib.pyplot as plt. You can then use use the functions available in the
# library import numpy as np import matplotlib.pyplot as plt # Create data x=range(1,6) y=[1,4,6,8,4] # Area plot plt.fill_between(x, y) plt.show()
⏱ Saving a plotly chart
Once you've created a
plotly chart you probably want to save it as a standalone
html file in order to share it or embed it in another webpage.
This is the code allowing to save a
plotly chart. You can read the full process here for instance.
⏱ Embeding a plotly chart
Once the chart has been saved, you can embed it in a html document using:
<iframe src="the/path/to/chart-name.html" width="800" height="600" title="chart name" style="border:none"> </iframe>