GenericMappingTools / GenericMappingTools/pygmt

Better support for plotting text in 3D at different heights

Open
#1,393 2 comments 0 reactions 1 assignee Claimed by @landryza View on GitHub
feature request good first issue help wanted
Dominant language
Python
Stars
874
Forks
255
Avg merge
1d 21h
Merged PRs (30d)
40

Description

**Description of the desired feature**

For 3D plots, it should be possible to plot text at different heights based on a 'z' column, see https://docs.generic-mapping-tools.org/6.2/text.html#z. The current implementation of `text` in PyGMT (see https://www.pygmt.org/v0.4.0/api/generated/pygmt.Figure.text.html) does support this, but users have to provide the xyz input into the `textfiles` parameter, and it is also not very discoverable for new users.

It would be nice to have a `z` parameter (in addition to `x` and `y`) to be clear that `text` does support multi-height plotting. Here's a checklist for anyone wanting to work on this 'enhancement'.

TODO:
1. Alias the [`-Z`](https://docs.generic-mapping-tools.org/6.2/text.html#z), call it `zvalue` (as in `plot3d`)?
2. Add the `z` parameter here:
https://github.com/GenericMappingTools/pygmt/blob/945bbc57ffc89a7c29384df48a653295b3f1a435/pygmt/src/text.py#L48-L49
3. Modify the code here to mention that x/y/z triples are also possible (~~need to wait for #1121 though~~ edit: done!):
https://github.com/GenericMappingTools/pygmt/blob/945bbc57ffc89a7c29384df48a653295b3f1a435/pygmt/src/text.py#L160-L170
4. Update the `text` API docstring to document the new behaviour.
5. (Optional) Update the tutorial at https://www.pygmt.org/v0.4.0/tutorials/text.html to mention that z-value inputs are supported too.

**Are you willing to help implement and maintain this feature?** Please wait for #1121 before starting work on this (Edit: that PR is merged, so ready to start)!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.