-
Notifications
You must be signed in to change notification settings - Fork 255
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
09750d0
db74bc2
8e8ddc2
19f8726
d1e1b14
a9ab2b7
7b85abf
45390bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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, | ||
|
|
@@ -296,20 +297,23 @@ def colorbar( | |
| .. 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 | ||
| :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 of | ||
|
yvonnefroehlich marked this conversation as resolved.
Outdated
|
||
| 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. | ||
|
Comment on lines
297
to
+308
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. I feel this note can be moved to the docstrings for |
||
|
|
||
| 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 | ||
| For GMT >=6.5.0, the fontsizes used for the colorbar are scaled automaticly | ||
| based on the length of the colorbar. For GMT >= 6.7.0, use this parameter to | ||
| turn of the this automatic fontsize scaling. | ||
|
yvonnefroehlich marked this conversation as resolved.
Outdated
|
||
| $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), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.