I want to make markersize equal to a single unit in height. It seems that markersize is in pixels. How can I get at how large “1 unit” (along a given axis) is, in pixels?
I want to make markersize equal to a single unit in height. It seems
Share
Have a look at the Transformations tutorial (wow, that took a lot of digging to find — !)
In particular,
axes.transData.transform(points)returns pixel coordinates where (0,0) is the bottom-left of the viewport.There are various other transforms you can do — coordinates relative to your data, relative to the axes, as a proportion of the figure, or in pixels for the figure (the transformations tutorial is really good).
TO convert between pixels and points (a point is 1/72 inches), you may be able to play around with
matplotlib.transforms.ScaledTransformandfig.dpi_scale_trans(the tutorial has something on this, I think).