我正在绘制一个2d线(x1,y1) - >(x2,y2)并使用Affine2D.rotate_deg_around在matplotlib中旋转角度theta。matplotlib旋转后的新线坐标
start = (120, 0)
ht = 100
coords = currentAxis.transData.transform([start[0],start[1]])
trans1 = mpl.transforms.Affine2D().rotate_deg_around(coords[0],coords[1], 45)
line1 = lines.Line2D([start[0], start[0]], [start[1], ht+start[1]], color='r', linewidth=2)
line1.set_transform(currentAxis.transData + trans1)
currentAxis.add_line(line1)
现在(x2,y2)在旋转之后不会是(120,100)。我需要在旋转后找到新的(x2,y2)。
我已经尝试过了。它给我创造一条线时通过的值,即[120,120]和[0,100]。我需要转化点。 –