简体   繁体   中英

matplotlib: get projection coordinates

I saw this post and added a print label.get_position() . It looks like this command returns the 2D-coordinates of the label, let's call it (u,v)-coordinates as marked green in the picture below. Now my question: Is there a way to get these (u,v)-coordinates of a certain 3D-point ? How?

Edit: For example: I have a 3D-point with the (x,y,z)-coordinates (1,1,1). I want matplotlib to return me the (u,v)-coordinates of this point when I rotate the view around. In my example: In the first case, matplotlib should return me (4,3), in the second case (6,4). Hope this is clear enough now =)

在此处输入图片说明

Following the linked example, you use

x2, y2, _ = proj3d.proj_transform(x1,y1,z1, ax.get_proj())

To get the projection of 3D -> 2D.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM