How to apply MarkerStyle transformation to the legend

When I transform a MarkerStyle, it displays fine in the plot but not in the legend:

import matplotlib.pyplot as ppl
from matplotlib.markers import MarkerStyle

hdiamond = MarkerStyle("d")
ppl.plot(0, 0, marker = hdiamond, label = 'foo', ls = 'None')

This results in:

Screen Shot 2021-07-09 at 13.33.33

How can I correct the problem?

This looks like a bug to me, you can open an issue on the tracker (Issues · matplotlib/matplotlib · GitHub).

It’s now done, thanks.

For reference, this is fixed in 3.4.2.