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()

enter image description here

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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -