= size / 2 * [(-1, -1), (+1, -1), (+1, +1), (-1, +1), (-1, -1)]
# 初始T
T = rotation.transform(T) # 旋转后的...T
rotation = Affine2D().rotate_deg(orientation)
P = center + T # 旋转后的T + center
在上面的代码中,我们定义了四个点来确定新轴的范围...,并利用matplotlib的仿射变换来进行实际的旋转。...ax.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "y--",
transform=trans_data, zorder=10)
在浮动轴画布上添加图像...:
do_plot(ax2, I, transform=Affine2D())
在固定轴画布上添加图像:
do_plot(ax1, I, transform=Affine2D())
参考资料
[