Is the Keyword Argument 'transform' of PathPatch Deprecated?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is the Keyword Argument 'transform' of PathPatch Deprecated?

Amit Yaron
It makes actors disappear ,but when I use 'transform_path' it works fine.
Following is an example code snippet:

theta=np.arcsin(0.6)
trans=transforms.Affine2D().rotate_around(76.5,32.5,theta)#.transform_path(textPath5)
pathPatch=patches.PathPatch(textPath5,alpha=1,transform=trans);

Thanks,
   Amit

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Is the Keyword Argument 'transform' of PathPatch Deprecated?

Elan Ernest
No, the transform argument is not deprecated, and it works as intended.
The problem is that your transform ommits the transformation from the
axes' data space to pixels and hence rotates the patch directly in pixel
space.

To rotate in data space, use

transform = trans + ax.transData


Am 30.07.2019 um 14:18 schrieb Amit Yaron:

> It makes actors disappear ,but when I use 'transform_path' it works fine.
> Following is an example code snippet:
>
> theta=np.arcsin(0.6)
> trans=transforms.Affine2D().rotate_around(76.5,32.5,theta)#.transform_path(textPath5)
>
> pathPatch=patches.PathPatch(textPath5,alpha=1,transform=trans);
>
> Thanks,
>   Amit
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users