3 different rotation degree:
Hi, I am trying to rotate Matplotlib Collections.PatchCollection (circles). I could not keep the same point of rotation.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.collections
import matplotlib as mpl
num = 5
sizes = 0.01, 0.01, 0.01, 0.01, 0.01
xy = (.5,.7),(.5,.6),(.5,.5),(.5,.4),(.5,.3)
print(xy)
# Note that the patches won't be added to the axes, instead a collection will
patches = [plt.Circle(center, size) for center, size in zip(xy, sizes)]
patches2 = [plt.Circle(center, size) for center, size in zip(xy, sizes)]
fig, ax = plt.subplots(1,1)
coll = matplotlib.collections.PatchCollection(patches, facecolors='none')
coll2 = matplotlib.collections.PatchCollection(patches2, facecolors='None')
ax.add_collection(coll)
ax.add_collection(coll2)
t2 = mpl.transforms.Affine2D().rotate_deg(12.5) + ax.transData
coll2.set_transform(t2)
plt.show()
How to keep the same point of rotation after rotation? Thanks in advance


