Description
Hello,
I am new here and I dont know if this is the right place, but I found a slight misbehave, when creating a custom markerstyle. If you plot something, eg:
pyplot.plot([0,0], [1,1], markersize=5, marker=[[0,0], [0,1], [1, 1], [1,0]) # marker is a square with size 1
The marker has the same size as marker='s', but is not centered. If you use
pyplot.plot([0,0], [1,1], markersize=5, marker=[[-0.5,-0.5], [-0.5,0.5], [0.5,0.5]], [0.5,-0.5]) # still square of size 1
the resulting marker is centered but twice the size. The problem is the the function MarkerStyle._set_custom_marker in markers.py:
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
It rescales the given vertices, but considers only the max xy values, which results in twice. the size A solution could be to change the rescale factor to:
x, y = verts[:,0], verts[:,1]
rescale = max(abs(np.max(x) - np.min(x)), abs(np.max(y) - np.min(y)))