-
Notifications
You must be signed in to change notification settings - Fork 229
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:
- Alias the
-Z
, call itzvalue
(as inplot3d
)? - Add the
z
parameter here:
Lines 48 to 49 in 945bbc5
x=None, y=None, - Modify the code here to mention that x/y/z triples are also possible (
need to wait for Refactor text to use virtualfile_from_data #1121 thoughedit: done!):
Lines 160 to 170 in 945bbc5
if position is None: kind = data_kind(textfiles, x, y, text) else: if x is not None or y is not None: raise GMTInvalidInput( "Provide either position only, or x/y pairs, not both" ) kind = "vectors" if kind == "vectors" and text is None: raise GMTInvalidInput("Must provide text with x/y pairs or position") - Update the
text
API docstring to document the new behaviour. - (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)!