I am trying to format my graph nicely, but I can't figure out how to scale down the legend picture of my line.

Is there a simple way to make that GDP legend line smaller? Thank you.

See picture here


#setting size arrays
scatterSize = []
for eachGDP in gdp:
   size = abs(eachGDP)*300

ax.scatter(y_pos, gdp, color = 'purple', linewidth = .5, s = scatterSize, label = 'GDP')

plt.legend(loc = 'upper left',prop={'size': 10})
Solved: plt.legend(markersize = .2, loc = 'upper left',prop={'size': 10}) – James Salafatinos

1 Answers 11

Should have read documentation closer. There is an argument for markersize.

plt.legend(markersize = .2, loc = 'upper left',prop={'size': 10})

See fix:


Not the answer you're looking for? Browse other questions tagged or ask your own question.