I am looking for a way to include a (matplotlib) legend that describe the size of points in a scatter plot, as this could be related to another variable, like in this basic
I found this here, it is so easy and concise. Hope it helps
import matplotlib.pyplot as plt
import numpy as np
import plotly.plotly as py
import plotly.tools as tls
fig = plt.figure()
ax = fig.add_subplot(111)
x = [0,2,4,6,8,10]
y = [0]*len(x)
s = [100, 400, 490, 600, 240, 160] # Specifies marker size
ax.scatter(x,y,s=s)
ax.set_title('Plot with Different Marker size, matplotlib and plotly')
plotly_fig = tls.mpl_to_plotly( fig )
plotly_fig['layout']['showlegend'] = True
plotly_url = py.plot(plotly_fig, filename='mpl-marker-size')