WIP: Figure.colorbar: Add alias "no_font_scaling" for "-H" - #4783
WIP: Figure.colorbar: Add alias "no_font_scaling" for "-H"#4783yvonnefroehlich wants to merge 8 commits into
Conversation
|
maybe font_scaling with default |
Hmmm. Seems we will have fun with double negatives here 😅. My understanding and thoughts so far are: |
|
we can use |
After thinking it twice, I agree that |
| turn of the this automatic fontsize scaling. | ||
| $projection | ||
| $region | ||
| $verbose |
There was a problem hiding this comment.
The -H option only exists in GMT>=6.7.0, so need to check the current GMT version, and raise an exception if GMT 6.5/6.6 is used and no_font_scaling=True.
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Actually, I wonder if we should have the default to be no font scaling. From what I hear, the font scaling feature has confused users for a few years, and people may prefer no font scaling as the default. So, what about having
I know it's inconsistent with the default GMT behavior, but I wonder if no font scaling is more frequently used. |
Likely a bad idea, because |
| .. note:: | ||
| For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations, | ||
| and y-label are scaled based on the width of the colorbar following | ||
| :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize via the | ||
| By default, the fontsizes of the colorbar annotations, label, and unit | ||
| are scaled based on the width of the colorbar following | ||
| :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the | ||
| GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, | ||
| :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly | ||
| :gmt-term:`FONT`) users have to divide the desired fontsize by the value | ||
| calculated with the formula given above before passing it to the default | ||
| parameters. To only affect fontsizes related to the colorbar, the | ||
| defaults can be changed locally only using ``with pygmt.config(...):``. | ||
| :gmt-term:`FONT`) | ||
| For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn off | ||
| the automatic fontsize scaling. | ||
| For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the | ||
| value calculated with the formula given above before passing it to the | ||
| default parameters. |
There was a problem hiding this comment.
I feel this note can be moved to the docstrings for no_font_scaling.
Description of proposed changes
This PR aims to add an alias for the newly added -H flag of
colorbarof GMT 6.7.0. Currently it'sno_font_scaling. Feel free to make suggestion for a suitable alias.TODO
no_font_scalingdefaultFalseRelated: #4243
Preview: https://pygmt-dev--4783.org.readthedocs.build/en/4783/api/generated/pygmt.Figure.colorbar.html
Example
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