in makers.py I request to change
def _set_custom_marker(self, path):
verts = path.vertices
rescale = max(np.max(np.abs(verts[:,0])), np.max(np.abs(verts[:,1])))
self._transform = Affine2D().scale(1.0 / rescale)
self._path = path
to
def _set_custom_marker(self, path):
verts = path.vertices
rescale = np.max(np.sqrt(np.square(verts[:,0]) + np.square(verts[:,1])))
self._transform = Affine2D().scale(1.0 / rescale)
self._path = path
such that the symbol *radius* is normalized to 1.0
This way my previous example give better results if the symbol is rotated:
import matplotlib.path as path
from matplotlib.transforms import Affine2D
# define codes
P = path.Path
Pm = P.MOVETO
Pl = P.LINETO
Pc = P.CLOSEPOLY
c = [Pm] + [Pl]*3 + [Pc]
cx=c*2
# define basic path
r=np.array(((-1.,-1),(1.,-1),(1.,1.),(-1,1.),(-1,-1)))
# we add second closed path of half size but reverse parity
rh=0.5*r[::-1]
rx = np.vstack((r,rh))
p = path.Path(rx,codes=cx)
x = np.linspace(0,1,10)**2
plot(x,c='r',marker=p,ms=10)
pr = p.transformed(Affine2D().rotate_deg(45.))
plot(x,c='r',marker=pr,ms=10)
show()
I think this is how it is "meant" to be, but maybe you have to add a parameter to allow people recover the current behavior in that case.
-Alexander
···
====
I just like round cows better than square cows.