POC: DOC: A note recommending to call pygmt.config after pygmt.Figure() - #4735
POC: DOC: A note recommending to call pygmt.config after pygmt.Figure()#4735yvonnefroehlich wants to merge 5 commits into
Conversation
|
|
||
| .. note:: | ||
|
|
||
| Currently, :class:`pygmt.config` needs to be called **after** setting |
There was a problem hiding this comment.
Actually, the note only make sense when multiple Figure instances are created in one session.
| .. note:: | ||
|
|
||
| For GMT defaults to adjust the figure appearance, e.g., the font size, | ||
| :class:`pygmt.config` needs to be called **after** setting up the |
There was a problem hiding this comment.
Maybe just say "it's recommended to call pygmt.config after ..."
There was a problem hiding this comment.
I feel the wording "global" and "local" are a little misleading. Perhaps we should call them "permanent" and "temporary" instead, similar to the wording we use for Figure.shift_origin.
We also need to document https://docs.generic-mapping-tools.org/dev/reference/features.html#gmt-modern-mode-hierarchical-levels, but it could be done in a separate PR.
| Change GMT default settings globally or locally. | ||
|
|
||
| Change GMT default settings globally:: | ||
|
|
||
| pygmt.config(PARAMETER=value) | ||
|
|
||
| Change GMT default settings locally by using it as a context manager:: | ||
|
|
||
| with pygmt.config(PARAMETER=value): | ||
| ... |
There was a problem hiding this comment.
I feel the wording "global" and "local" are a little misleading. Perhaps we should call them "permanent" and "temporary" instead
Meaning we need to update the docs (and likely some examples) make the formulations consistent?
There was a problem hiding this comment.
Yes, the word "global" gives users the wrong impression that it has a global effect, but actually it only affects the configurations of the current figure, current subplot, or current inset (xref: https://docs.generic-mapping-tools.org/dev/reference/features.html#gmt-modern-mode-hierarchical-levels), depending on where pygmt.config() is called.
There was a problem hiding this comment.
I agree, we need to document the behaviour more detailed and clearly.
Description of proposed changes
Related to several issues, e.g., #733, #4732.
Need to read about -H of colorbar available for GMT >=6.7.0 (as mentioned in https://forum.generic-mapping-tools.org/t/psscale-colorbar-and-its-label-font-size/6472/4?u=yvonnefroehlich) to see if this can be helpful for PyGMT also and whether we should at an aliasa for -H; related to #3041 -> PR #4783.
Preview: https://pygmt-dev--4735.org.readthedocs.build/en/4735/api/generated/pygmt.config.html
Guidelines
Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash command is:
/format: automatically format and lint the code