import plotly
plotly.__version__
'1.0.33'
import plotly.plotly as py
import plotly.tools as tls
help(py.image)
Help on class image in module plotly.plotly.plotly: class image | Helper functions wrapped around plotly's static image generation api. | | Class methods defined here: | | ishow(cls, figure) from __builtin__.classobj | Display a static image of the plot described by `figure` | in an IPython Notebook. | | save_as(cls, figure, filename) from __builtin__.classobj | Save a static image of the plot described by `figure` | locally as `filename`. | | ---------------------------------------------------------------------- | Static methods defined here: | | get(figure) | Return a static image of the plot described by `figure`.
#fig = py.get_figure('etpinard','270')
#fig = py.get_figure('https://plot.ly/~etpinard/270/number-of-songs-listed-in-the-guardians-top-1000-songs-to-hear-before-you-die-pe/')
fig = py.get_figure('https://plot.ly/~etpinard/270/')
print fig.to_string()
Figure( data=Data([ Bar( x=['Bob Dylan', 'The Beatles', 'David Bowie', 'Randy Newman', '...], y=[24, 19, 9, 8, 8, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5...], text=[u'Girl from the North Country (1963)<br>Don\u2019t Think...], marker=Marker( color='#2ca02c' ) ) ]), layout=Layout( title="Number of songs listed in the Guardian's<br><em>Top 1,000 So...", font=Font( family='Georgia, serif', color='#635F5D' ), showlegend=False, autosize=False, width=700, height=500, xaxis={'tickangle': 45, 'ticklen': 8, 'tickwidth': 1.5, 'ticks': 'o...}, yaxis={'gridcolor': '#FFFFFF', 'ticklen': 8, 'tickwidth': 1.5, 'tic...}, annotations=Annotations([ Annotation( x=0.95, y=0.95, xref='paper', yref='paper', text='<em>Open Data by Socrata</em><br>Hover over the bars ...', font=Font( size=14 ), showarrow=False, borderpad=4, bgcolor='#FFFFFF' ) ]), margin=Margin( b=140 ), plot_bgcolor='#EFECEA' ) )
py.image.ishow(fig)
py.image.save_as(fig, 'socrata_1000-songs')
ls
save-fig-test.ipynb socrata_1000-songs.png
from IPython.display import Image
Image(filename='socrata_1000-songs.png')