Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D annotations (text) in plot3d #2001

Closed
andrebelem opened this issue Jul 10, 2022 · 7 comments
Closed

2D annotations (text) in plot3d #2001

andrebelem opened this issue Jul 10, 2022 · 7 comments
Labels
feature request New feature wanted

Comments

@andrebelem
Copy link
Contributor

I've been working a lot with pygmt's 3D (plot3D) fields, and it's excellent!
However, the biggest difficulty is that when I need to annotate any point in the figure, the use of the "l" option (-Sl n GMT) only allows it to write in 3D, when in fact it would be interesting to have the text in 2D, in the position X Y Z.

Another interesting point is that as much as I try to change the text justification via "+jBL" to bottom left, the text doesn't change, being always centered.

@andrebelem andrebelem added the feature request New feature wanted label Jul 10, 2022
@welcome
Copy link

welcome bot commented Jul 10, 2022

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

@maxrjones
Copy link
Member

Thanks for the feedback @andrebelem! For the first point, do you think the solution proposed in #1393 would work for your use case?

@andrebelem
Copy link
Contributor Author

andrebelem commented Jul 11, 2022

Thanks for the feedback @andrebelem! For the first point, do you think the solution proposed in #1393 would work for your use case?

Humm..that's very interesting. So, if I understood well, pygmt.text should work for a given x/y/z text?

@maxrjones
Copy link
Member

This is an example of that option in use for GMT - https://docs.generic-mapping-tools.org/latest/gallery/ex08.html. While the text is plotted at z=0, it could be plotted at other elevations.

@andrebelem
Copy link
Contributor Author

Well, that's the problem. The text written on top of the cube is in perspective. My suggestion is to have the position anchor based on X/Y/Z but write "flat", in 2D (for example as ETOPO5 is written in the title).

I had already seen the text (pstext) and tried several alternatives here, and I was only able to do it "by hand" by placing a basemap over the 3D, but it is much harder to get right.

@maxrjones
Copy link
Member

I'm not sure the best way to accomplish the map you're looking for. Could you pose the question to the GMT forum to find out if there's an easier way to get that appearance using GMT, which would inform whether we can support that in PyGMT?

@andrebelem
Copy link
Contributor Author

Sorry for the long delay.
I did some testing and managed to create a reasonable workflow for these 2D annotations (on a 3D map) using basemap overlap. For now I won't open another request because I know you guys are very busy. But I'll keep my eyes peeled on the forum, who knows if anyone else sees this need for plain text in 3D (for now, it looks like just me).
But thank you for the concern. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature wanted
Projects
None yet
Development

No branches or pull requests

2 participants