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

Figure.text: Improve the documentation to clarify the order of columns in the input files #2832

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions pygmt/src/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,21 @@ def text_( # noqa: PLR0912
Parameters
----------
textfiles : str or list
A text data file name, or a list of file names containing 1 or more
records with (x, y[, angle, font, justify], text).
A file name or a list of file names containing one or more records.
Each record has the following columns:

* *x*: X coordinate or longitude
* *y*: Y coordinate or latitude
* *angle*: Angle in degrees counter-clockwise from horizontal
* *font*: Text size, font, and color
* *justify*: Two-character justification code
Copy link
Member

@yvonnefroehlich yvonnefroehlich Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we write currently two-character justification code. But we write

  • below for the justify parameter two-letter combination
  • in the colorbar example 2-character combination
  • in the text tutorial two-letter (order independent) code
  • etc.

I think it would be nice to formulate this consistently. This is a bit related to issue #2834. I will try to find time to look at this in more detail; currently busy with other things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can simplify these descriptions if issue #2834 is addressed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then maybe we leave these formulations as they are for now, and make it consistent via addressing #2834 🙂.

* *text*: The text string to typeset

The *angle*, *font*, and *justify* columns are optional and can be set
by using the ``angle``, ``font``, and ``justify`` parameters,
respectively. If these parameters are set to ``True``, then the
corresponding columns must be present in the input file(s) and the
columns must be in the order mentioned above.
x/y : float or 1-D arrays
The x and y coordinates, or an array of x and y coordinates to plot
the text.
Expand Down