2
center
속성을 수정하여 matplotlib.patches.Wedge
의 위치를 변경하려고 시도했지만 아무런 영향이없는 것 같습니다. 예를 들어쐐기 패치 위치가 업데이트되지 않음
:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)
tmp = patches.Wedge([2, 2], 3, 0, 180)
ax.add_artist(tmp)
tmp.center = [4, 4] # Try to move!
ax.set_xlim([0, 10])
ax.set_ylim([0, 10])
print(tmp.center)
plt.show()
는 다음을 생성합니다 : 분명히 잘못된 것입니다
합니다. 미세 matplotlib.patches.Ellipse
위한
유사한 접근 기능 :
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)
tmp = patches.Ellipse([2, 2], 2, 2)
ax.add_artist(tmp)
tmp.center = [4, 4] # Try to move!
ax.set_xlim([0, 10])
ax.set_ylim([0, 10])
print(tmp.center)
plt.show()
그리고
matplotlib.patches.Rectangle
(
xy
-
center
의 변화)
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)
tmp = patches.Rectangle([2, 2], 3, 2)
ax.add_artist(tmp)
tmp.xy = [4, 4] # Try to move!
ax.set_xlim([0, 10])
ax.set_ylim([0, 10])
print(tmp.xy)
plt.show()
,
center
보다는 xy
을 사용하는 것이 Wedge
일 수 있다고 생각했지만 Wedge
개체에는 xy
속성이 없습니다. 내가 여기서 무엇을 놓치고 있니?