Show Sidebar Hide Sidebar
matplotlib

Plotly Matplotlib Library

Publish your Matplotlib figures to the web with one line of code! Examples of how to make line plots, scatter plots, area charts, bar charts, error bars, box plots, histograms, heatmaps, subplots, multiple-axes, polar charts and bubble charts.

Instructions on how to install Plotly's Python package can be found on the Plotly for Python getting started page.
Instructions on how to install matplotlib can be found at https://matplotlib.org/users/installing.html.


import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
import plotly.plotly as py

py.sign_in('DemoAccount', 'lr1c37zw81')

n = 50
x, y, z, s, ew = np.random.rand(5, n)
c, ec = np.random.rand(2, n, 4)
area_scale, width_scale = 500, 5

fig, ax = plt.subplots()
sc = ax.scatter(x, y, c=c,
                s=np.square(s)*area_scale,
                edgecolor=ec,
                linewidth=ew*width_scale)
ax.grid()

plot_url = py.plot_mpl(fig)

						

Documentation Examples

Basic Charts
Statistical and Seaborn-style Charts
Scientific Charts
3D Charts
Layout Options
Tutorial
Image Export & Retrieving Plots
Statistics