Plotly in Python: How to add legend when using matplotlib? -
in plotly, can convert matplotlib figure plot.ly:
x=[1,2,3] y=[4,5,6] plt.plot(x,y,label='test') fig=plt.gcf()
however, if add legend,
x=[1,2,3] y=[4,5,6] plt.plot(x,y,label='test') fig=plt.gcf() plt.legend()
it return error runtimeerror: cannot window extent w/o renderer
i want know problem? plot.ly support legend made matplotlib?
adding showlegend=true
plt.plot(x,y,label='test')
trick.
Comments
Post a Comment