I took this code from the site (mostly):
import plotly.plotly as py
from plotly.graph_objs import Bar, Scatter, Figure, Layout
trace = Bar(x=[1,2,3],y=[4,5,6])
data = [trace]
layout = Layout(title=‘My Plot’)
fig = Figure(data=data,layout=layout)
Save the figure as a png image:
py.image.save_as(fig, ‘my_plot.png’)
and when I run it I get the following error:
Traceback (most recent call last):
File “chart.py”, line 22, in
py.image.save_as(fig, ‘/home/ubuntu/coinbase/my_plot.png’)
File “/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py”, line 787, in save_as
img = cls.get(figure_or_data, format, width, height, scale)
File “/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py”, line 710, in get
raise exceptions.PlotlyError(return_data[‘error’])
KeyError: ‘error’
Any ideas?