-
Notifications
You must be signed in to change notification settings - Fork 218
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
Tutorial "Plotting text": Rewrite to improve structure, explain more parameters, show list input #2760
Conversation
Sorry to be mean here, but I think the "Plotting text" tutorial (both the old version and the current new version) is not as good as other tutorials. In other tutorials, we usually start with a simple plot with a few required parameters and then improve the plot by adding more parameters step by step in the following sections, but in this tutorial, we start with a nice map and then start to explain the Here are my thoughts about the tutorial:
|
No worries @seisman. My initial intent for this PR was only to add a code example regarding list input for |
I tried to address the issues mentioned by @seisman in #2760 (comment). @GenericMappingTools/pygmt-maintainers do you think the current changes are improving this tutorial? |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Description of proposed changes
This PR aims to expand and update the tutorial "Plotting text":
position
parameter along withjustify
pen
parameter along withfill
justify
,font
,angle
,fill
+pen
via simple Cartesian plotsjustify
,font
, andangle
(possible after PR Figure.text: Support passing in a list of angle/font/justify values #2720) beside providing an external input filePlease state, whether these changes are improvements, or that we should keep the current version.
Changes suggested by @seisman to improve the structure of the tutorial (see comment #2760 (comment)):
text="SOUTH CHINA SEA", x=112, y=6
)angle
/font
/justify
/pen
/fill
parameters to adjust the texts (maybe one map forangle
/font
/justify
and another map forpen
/fill
Figure.text
call (e.g., pass 1-D arrays tox
/y
/text
)angle
/font
/justify
can also accept 1-D arrays (maybe combine 3 and 4 into one map)data
textfiles
position
parameter. A useful use case for this parameter is to add a tag (e.g.,(a)
) at the top left corner of the map for multiple subplots, but we should also mention that theFigure.subplot
method can do this automatically.Preview: https://pygmt-dev--2760.org.readthedocs.build/en/2760/tutorials/basics/text.html
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version