Skip to content

Instantly share code, notes, and snippets.

@wjladams
Created December 4, 2017 19:42
Show Gist options
  • Save wjladams/fcd1aad85532ca2f7eaa665dcfbede38 to your computer and use it in GitHub Desktop.
Save wjladams/fcd1aad85532ca2f7eaa665dcfbede38 to your computer and use it in GitHub Desktop.
plotly scatterplot example
#Import and initialize notebook mode. Generally run from Jupyter
from plotly.offline import plot, iplot, init_notebook_mode
from plotly.graph_objs import Scatter, Layout
init_notebook_mode()
#Data
xs = [1, 2, 3, 4, 5, 6, 7, 8, 9]
ys = [1, 1.5, 3, 4, 5, 5.5, 5.9, 6.05, 6.1]
#Plot
iplot([Scatter(x=xs, y=ys)])
@wjladams
Copy link
Author

wjladams commented Dec 4, 2017

Handles importing plotly, initializing notebook and very silly plot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment