Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode, or in jupyter notebooks.
We also have a quick-reference cheatsheet (new!) to help you get started!!
Checkout this notebook to compare WebGL and SVG scatter plots with 75,000 random data points
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
N = 100000
trace = go.Scattergl(
x = np.random.randn(N),
y = np.random.randn(N),
mode = 'markers',
marker = dict(
line = dict(
width = 1,
color = '#404040')
)
)
data = [trace]
py.iplot(data, filename='WebGL100000')
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
N = 1000000
trace = go.Scattergl(
x = np.random.randn(N),
y = np.random.randn(N),
mode = 'markers',
marker = dict(
color = 'rgb(152, 0, 0)',
line = dict(
width = 1,
color = 'rgb(0,0,0)')
)
)
data = [trace]
py.iplot(data, filename='WebGLmillion')
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
data = []
trace_num = 10
point_num = 5000
for i in range(trace_num):
data.append(go.Scattergl(
x = np.linspace(0, 1, point_num),
y = np.random.randn(point_num)+(i*5)
)
)
layout = dict(showlegend=False)
fig=dict(data=data, layout=layout)
py.iplot(fig, filename='WebGL_line')
See https://plotly.com/python/reference/#scattergl for more information and chart attribute options!
from IPython.display import display, HTML
display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700" rel="stylesheet" type="text/css" />'))
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))
! pip install git+https://github.com/plotly/publisher.git --upgrade
import publisher
publisher.publish(
'webgl.ipynb', 'python/webgl-vs-svg/', 'Python WebGL vs SVG | plotly',
'Implement WebGL for increased speed, improved interactivity, and the ability to plot even more data!',
title = 'Python WebGL vs SVG | plotly',
name = 'WebGL vs SVG',
has_thumbnail='true', thumbnail='thumbnail/webgl.jpg',
language='python',
display_as='basic', order=0.5,
ipynb= '~notebook_demo/44')
/usr/local/lib/python2.7/site-packages/IPython/nbconvert.py:13: ShimWarning: The `IPython.nbconvert` package has been deprecated. You should import from nbconvert instead. "You should import from nbconvert instead.", ShimWarning) /usr/local/lib/python2.7/site-packages/publisher/publisher.py:53: UserWarning: Did you "Save" this notebook before running this command? Remember to save, always save. warnings.warn('Did you "Save" this notebook before running this command? '