6

Matplotlib (png からインポート) で 2D 画像をプロットし、任意の角度で回転させようとしています。時間の経過に伴うオブジェクトの回転を示す簡単なアニメーションを作成したいのですが、今は画像を回転させようとしています。次のコードでいくつかのバリエーションを試しましたが、成功しませんでした:

import matplotlib.pyplot as plt
import matplotlib.transforms as tr
import matplotlib.cbook as cbook

image_file = cbook.get_sample_data('ada.png')
image = plt.imread(image_file)

imAx = plt.imshow(image)
rot = tr.Affine2D().rotate_deg(30)
imAx.set_transform(imAx.get_transform()+rot)

plt.axis('off') # clear x- and y-axes
plt.show()

私は何かが欠けていると確信していますが、matplotlibのドキュメントと例からそれを理解することができませんでした.

ありがとう!

4

1 に答える 1