%run talktools
Plotly is an online analytics and data visualization tool.
from IPython.display import IFrame
IFrame("https://plot.ly/~Dreamshot/407", width="900px", height='500px')
from IPython.display import IFrame
IFrame("https://plot.ly/~PlotBot/3", width="900px", height='500px')
$\TeX$ provides a system that gives exactly the same results on all computers
$\TeX$ allows anybody to produce high-quality documents efficiently
Plotly applies the same core principles to graphs
Plotly solves this collaboration (i.e. reproducibility) problem:
from IPython.display import IFrame
IFrame("https://plot.ly/python/histograms/#Overlaid-Histgram", width="1100px", height='520px')
from IPython.display import IFrame
IFrame("https://plot.ly/matlab/histograms/#Overlaid-Histgram", width="1100px", height='520px')
from IPython.display import IFrame
IFrame("https://plot.ly/r/histograms/#Overlaid-Histgram", width="1100px", height='520px')
That's OK.
Our libraries come with figure converters allowing
figures to be converted to Plotly figures with one line of code!
from IPython.display import IFrame
IFrame("https://plot.ly/matplotlib/", width="1100px", height='520px')
Plotly allows you to retrieve a figure's underlying JSON object!
For example, in Python:
import plotly.plotly as py
fig = py.get_figure("https://plot.ly/~etpinard/450")
fig
import plotly.plotly as py
fig = py.get_figure("https://plot.ly/~etpinard/450") # as in last slide
# Modify the title
fig['layout'].update(title="The Historical Population of Portland, OR")
# Modify the y-axis label
fig['layout']['yaxis'].update(title="Population")
# Plots the data with marker points (not line)
fig['data'][0].update(mode='markers')
# Re-generate plot, get a unique URL
py.plot(fig, filename="tug-conf-example")
Go to plot's URL (or use py.iplot()
to embed plot in IPython notebook)
import plotly.plotly as py
py.image.save_as(fig, filename='test.png')
from IPython.display import Image
Image("test.png")