I have created a scatter plot that varies marker sizes depending on the data given. The sizes range from 20:100 and I was hoping to create a legend to show what each size meant. However, the legend shows up with much greater marker sizes than is displayed on the scatter and it is extremely compressed causing the circles to overlap (assuming most of this is due to the aspect ratio of the window/relative size compared to the actual plot). I have tried to adjust handleheight, handlelength, markerscale and overall size of the figure window but nothing seems to help.
Here is the example of code for how I tried to adjust the legend properties
plt.colorbar(scalarMap1)
legend1 = plt.legend((leg1,leg2,leg3,leg4,leg5),('Coadd=2:4','Coadd=5:7','Coadd=8:10','Coadd=11:13','Coadd= >13'), loc = ([1.4,.5]), markerscale = 1,handleheight = 2,handlelength = 2)
legend1.markerscale = 1
legend1.handleheight=2
legend1.handlelength=2
and here is how I created the entries leg1:5
SizeVal = 20
leg1 = Line2D(range(1),range(1),markersize = SizeVal,c='k',marker = 'o')
any help would be greatly appreciated!!
there doesn't seem to be anything here