Set variable point size in matplotlib Set variable point size in matplotlib python-3.x python-3.x

Set variable point size in matplotlib


help(plt.plot) shows

  markersize or ms: float         

so it appears plt.plot does not allow the markersize to be an array.

You could use plt.scatter however:

ax1.scatter(data[0], data[1], marker='o', c='b', s=data[2], label='the data')

PS. You can also verify that plt.plot's markersize must be a float by searching for "markersize" in the official documentation.