Collection of markers with size set in data units

That said, please note that you may not get the “width” you desire from some markers, since marker’s “default” sizes don’t really make much sense (see e.g. https://github.com/matplotlib/matplotlib/issues/16623). A fix is in the works but will take some time.

For now, if you want to get the “real” widths or heights of the markers, you’ll have to pull from https://github.com/matplotlib/matplotlib/pull/16832, then use code like the following to get the “true” width and height of the marker (for markersize=1):

star = MarkerStyle('*')
bbox = star.get_path().transformed(star.get_transform()).get_extents()
star_unit_width = bbox.width
star_unit_height = bbox.height

Then to get a star with real width of desired_data_width, you’d need to do

plt.scatter(0, -1, marker='s', s=(xscale*desired_data_width/star_unit_width)**2)