-
Notifications
You must be signed in to change notification settings - Fork 254
WIP: Figure.colorbar: Add alias "no_font_scaling" for "-H" #4783
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
Open
yvonnefroehlich
wants to merge
8
commits into
main
Choose a base branch
from
add-alias-H-colorbar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16
−7
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
09750d0
Suggest an alias for '-H' of colorbar
yvonnefroehlich db74bc2
Merge branch 'main' into add-alias-H-colorbar
yvonnefroehlich 8e8ddc2
Merge branch 'main' into add-alias-H-colorbar
yvonnefroehlich 19f8726
Merge branch 'main' into add-alias-H-colorbar
yvonnefroehlich d1e1b14
Fix typo
yvonnefroehlich a9ab2b7
Improve formulation
yvonnefroehlich 7b85abf
Improve formulation
yvonnefroehlich 45390bf
Fix style
yvonnefroehlich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -272,6 +272,7 @@ def colorbar( | |
| scale: float | None = None, | ||
| monochrome: bool = False, | ||
| dpi: int | None = None, | ||
| no_font_scaling: bool = False, | ||
| projection: str | None = None, | ||
| region: Sequence[float | str] | str | None = None, | ||
| frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False, | ||
|
|
@@ -294,22 +295,25 @@ def colorbar( | |
| tile widths. | ||
|
|
||
| .. 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. | ||
|
|
||
| Full GMT docs at :gmt-docs:`colorbar.html`. | ||
|
|
||
| $aliases | ||
| - C = cmap | ||
| - F = box | ||
| - G = truncate | ||
| - H = no_font_scaling | ||
| - I = shading | ||
| - J = projection | ||
| - M = monochrome | ||
|
|
@@ -463,6 +467,10 @@ def colorbar( | |
|
|
||
| If not specified, GMT uses its default encoding behavior, and the default dpi | ||
| is 600 if the colorbar is drawn as image. | ||
| no_font_scaling | ||
| By default, the font sizes used for the colorbar are scaled automatically | ||
| based on the length of the colorbar. Set this parameter to ``True`` to | ||
| turn off the automatic scaling [Requires GMT>=6.7.0]. | ||
| $projection | ||
| $region | ||
| $verbose | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
@@ -518,6 +526,7 @@ def colorbar( | |
| ), | ||
| F=Alias(box, name="box"), | ||
| G=Alias(truncate, name="truncate", sep="/", size=2), | ||
| H=Alias(no_font_scaling, name="no_font_scaling"), | ||
| I=Alias(shading, name="shading", sep="/", size=2), | ||
| M=Alias(monochrome, name="monochrome"), | ||
| N=_alias_option_N(dpi=dpi), | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I feel this note can be moved to the docstrings for
no_font_scaling.