Skip to content

Instantly share code, notes, and snippets.

@trsqxyz
Last active August 29, 2015 14:24
Show Gist options
  • Save trsqxyz/feaf48266a976b90188e to your computer and use it in GitHub Desktop.
Save trsqxyz/feaf48266a976b90188e to your computer and use it in GitHub Desktop.
plotly でいい感じのグラフをオンラインに公開する ref: http://qiita.com/trsqxyz/items/27b84bb72de5371b062d
import plotly.plotly as py
from plotly.graph_objs import *
trace0 = Scatter(
x=[1, 2, 3, 4],
y=[10, 15, 13, 17]
)
trace1 = Scatter(
x=[1, 2, 3, 4],
y=[16, 5, 11, 9]
)
data = Data([trace0, trace1])
unique_url = py.plot(data, filename = 'basic-line')
layout = Layout(title='basic-line')
fig = Figure(data=data, layout=layout)
py.image.save_as(fig, filename='fig.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment