-
Notifications
You must be signed in to change notification settings - Fork 224
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
Allow use of matplotlib relative font sizes #617
Comments
Interesting idea. I'd like to hear from the rest of the team to see if this is within scope for |
It's more complicated, as GMT settings like FONT_TITLE set font type, size and color. |
In the GMT world, a font contains three attributes, size, fonttype and fill. An example of a valid font is To support relative font sizes like Actually, this is an interesting idea that may be implemented in GMT instead. For reference, GMT's pen attribute has syntax like Please open a feature request on the GMT repository if you're still interested. |
Matplotlib defines a set of relative font sizes, such as "medium" and "large". Unfortunately, matplotlib mixes absolute and relative font sizes in the rcParams dictionary. When using pygmt, I often take the font sizes from my existing rcParams dictionary, and then pass them to pygmt.config to customize my plots like this:
If the font size it somthing like "medium", pygmt.config doesn't know what to do and generates a warning.
One way around this would be for pygmt.config to convert the relative font sizes (str) to absolute font sizes (float). I found this method that does just this:
Another way would be to use this predifined dictionary:
The easiest thing to do would be to test if the font size is a string, and if True, use one of the above methods to convert it to points.
The text was updated successfully, but these errors were encountered: