change markersize in legend matplotlib 1

change markersize in legend matplotlib

lgnd = plt.legend(loc="lower left", scatterpoints=1, fontsize=10)
lgnd.legendHandles[0]._sizes = [30]
lgnd.legendHandles[1]._sizes = [30]

Here is what the above code is Doing:
1. We create a scatter plot of the two features.
2. We color code each point to its cluster.
3. We create a legend and make the size of each point bigger.

Similar Posts