Skip to content

Instantly share code, notes, and snippets.

@jeffgreenca
Created September 10, 2018 01:03
Show Gist options
  • Save jeffgreenca/6f231c888bc753100306edf9163bc4bb to your computer and use it in GitHub Desktop.
Save jeffgreenca/6f231c888bc753100306edf9163bc4bb to your computer and use it in GitHub Desktop.
Plotly init script for Jupyter notebooks
# Plotly init for Jupyter - https://plot.ly/python/reference/
from plotly.offline import init_notebook_mode, iplot
import plotly.graph_objs as go
init_notebook_mode(connected=True)
# Example (untested)
X = [1,2,3]
Y = [3,2,1]
trace0 = go.Scatter( x=X, y=Y )
data = go.Data([trace0])
layout = {"title": "hello"}
iplot(data, layout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment