Skip to content

Instantly share code, notes, and snippets.

@trsqxyz
Last active August 29, 2015 14:25
Show Gist options
  • Save trsqxyz/d78b3d55a4b27178d4cd to your computer and use it in GitHub Desktop.
Save trsqxyz/d78b3d55a4b27178d4cd to your computer and use it in GitHub Desktop.
plotly でいい感じのグラフをつくる ref: http://qiita.com/trsqxyz/items/d797919c19ee6c49ae72
trace = Bar(x=list(range(10)), y=list(np.random.randint(0,30,10)))
data = Data([trace])
py.image.save_as(data, filename='bar.png')
trace = Scatter(
x=list(range(8)),
y=list(np.random.randint(0,10,8)),
fill='tonexty',
mode='none'
)
trace2 = Scatter(
x=list(range(8)),
y=list(np.random.randint(0,10,8)),
fill='tonexty',
mode='none'
)
data = Data([trace, trace2])
py.image.save_as(data, 'field_area_plots.png')
trace = Heatmap(
z=[np.random.randint(1,50,50) for _ in range(50)],
colorscale='YIGnBu',
)
data = Data([trace])
py.image.save_as(data, filename='heatmap.png')
trace = Histgram(x=np.random.randn(500))
data = Data([trace])
py.image.save_as(data, filename='histogram.png')
trace = Bar(x=list(range(8)), y=list(np.random.randint(0,10,8)))
trace2 = Scatter(x=list(range(8)), y=list(np.random.randint(0,10,8)))
data = Data([trace, trace2])
py.image.save_as(data, filename='multiple.png')
import plotly.plotly as py
from plotly.graph_objs import *
trace = Scatter(x=list(range(10)), y=list(np.random.randint(0,30,10)))
data = Data([trace])
py.image.save_as(data, filename='scatter.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment