Skip to content
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

Update documentation for gmt themes #4717

Merged
merged 24 commits into from
Jan 31, 2021
Merged

Update documentation for gmt themes #4717

merged 24 commits into from
Jan 31, 2021

Conversation

maxrjones
Copy link
Member

Description of proposed changes

Updates the gmt.conf documentation to include theme dependent defaults and a description of auto scaling. Currently the text inside brackets link to a table with theme dependent settings, but this could be done in other ways if it is not currently clear.

@PaulWessel you should be able to build the docs now.

@PaulWessel
Copy link
Member

This looks great, @meghanrjones. However, since it is a bit new let's also get approval from @seisman and @joa-quim before merging. Meanwhile, two questions and possibly requests:

  1. MAP_FRAME_AXES: Maybe we need to explain that if auto then we will normally supply WrStZ but if a specific projection of perspective view makes that a bad choice then we supply what we believe is best.
  2. At the top of gmt.conf.rst it says "Note that default distances and lengths below are given in both cm or inch ; the chosen default depends on your choice of default unit (see PROJ_LENGTH_UNIT)". I think this is outdated and should be removed. It looks like almost all of the dimensions are now listed in points but users can supply their arguments in any of inch, cm, or points.
  3. Looks like FONT_SUBTITLE still needs to be updated to say [theme-dependent]?
  4. MAP_TICK_PEN_PRIMARY: I cannot recall why this is not auto like GRID_PENs and FRAME_PEN?

@maxrjones
Copy link
Member Author

1. **MAP_FRAME_AXES**: Maybe we need to explain that if auto then we will normally supply WrStZ but if a specific projection of perspective view makes that a bad choice then we supply what we believe is best.

Agreed, I will add some documentation after we merge the auto functionality for MAP_FRAME_AXES.

2. At the top of gmt.conf.rst it says "Note that default distances and lengths below are given in both cm or inch ; the chosen default depends on your choice of default unit (see PROJ_LENGTH_UNIT)".  I think this is outdated and should be removed.  It looks like almost all of the dimensions are now listed in points but users can supply their arguments in any of inch, cm, or points.

Agreed, I will update this separately because it is not themes-specific.

3. Looks like **FONT_SUBTITLE** still needs to be updated to say [theme-dependent]?

Thanks, updated.

4. MAP_TICK_PEN_PRIMARY: I cannot recall why this is not auto like GRID_PENs and FRAME_PEN?

It was applied in gmt_init.c, just not listed in share/themes. I added it to the documentation and themes .conf files.

@joa-quim
Copy link
Member

joa-quim commented Jan 29, 2021

I think we should clarify this, which in fact is not exactly true.

Note that default distances and lengths below are given in both cm or inch; the chosen default depends on your choice of default unit (see PROJ_LENGTH_UNIT).

The default is in fact cm only because that's what is hardwired in code. But users can create a gmtdefaults file with US units.

I like the table modern modes setting table. It goes straight to the point. However, I wonder if it should be in a separate page instead of a part of the gmt.conf. Not a big issue right now but when we start to add more themes the gmt.conf.rst may grow to undesirable size. Better to have a single document dedicated to themes.

In a separate matter, those [NOTICE] are annoying. I'm getting tons of them when running the Julia tests.

[NOTICE]: Computed primary annotation font size: 9.26667 p  Dimension scaling: 0.926667

@PaulWessel
Copy link
Member

The default is in fact cm only because that's what is hardwired in code. But users can create a gmtdefaults file with US units.

Looks like most things like offsets and ticklengths are given in points.

@maxrjones
Copy link
Member Author

The default is in fact cm only because that's what is hardwired in code. But users can create a gmtdefaults file with US units.

Looks like most things like offsets and ticklengths are given in points.

Yes, the output from gmtdefaults for lengths and distances is points regardless of whether the installation was SI or US. I do not think this is currently clear in the gmt.conf and gmtdefaults documentation. I will submit a PR with some changes, but I think the ultimate solution is to write a how-to guide for changing the configuration parameters and to link to that from the documentation for gmt.conf, gmtdefaults, and gmtset.

@joa-quim, the table for the themes settings is in a separate ReST file (explain_themes_settings.rst_) that is included in gmt.conf.rst, so it would be very easy to move this to a different location if the number of themes grows. Do you think it should be moved now?

@joa-quim
Copy link
Member

joa-quim commented Jan 29, 2021

We have a mix of points and cm. Fig and symbol sizes are in cm, but none are ever in in (uff, finally) unless specifically selected either on command line or in a defaults file.

@PaulWessel
Copy link
Member

Yes, the documentation is, or should be, either in points for relative small lengths and fonts, and cm for things that can be larger. If we find exceptions than each of us can do a quick PR to fix them.

@joa-quim
Copy link
Member

The fact that the theme is in a separate rst file is invisible to the user. Sorry, I was not clear. I think it would be better that it opens as a different document. Right, for now, with only one theme, it's fine to be includes but if we are going to extend it we could start right now. Not a big deal though.

@maxrjones
Copy link
Member Author

The fact that the theme is in a separate rst file is invisible to the user. Sorry, I was not clear. I think it would be better that it opens as a different document. Right, for now, with only one theme, it's fine to be includes but if we are going to extend it we could start right now. Not a big deal though.

Would you prefer the page to be free-standing, like proj specifications, or in the cookbook, like built-in cpts, both of which are included in the Quick Links table?

@joa-quim
Copy link
Member

Would you prefer the page to be free-standing, like proj specifications, or in the cookbook, like built-in cpts, both of which are included in the Quick Links table?

Yes, I think it would be better. More expansible.

@maxrjones
Copy link
Member Author

OK, it should be better now. I also added links to the auto scaling cookbook feature from all the parameters that can be automatically sized, and updated that page for recent changes (and the pending scale based on both height and width change).

@PaulWessel
Copy link
Member

This looks nice to me. @joa-quim, @seisman OK?

@seisman
Copy link
Member

seisman commented Jan 31, 2021

Looks good.

@joa-quim
Copy link
Member

Yes, looks nice.

@PaulWessel
Copy link
Member

OK to merge, @meghanrjones

@maxrjones maxrjones merged commit 3214e29 into gmt-themes Jan 31, 2021
@maxrjones maxrjones deleted the gmt-themes-docs branch January 31, 2021 17:58
PaulWessel added a commit that referenced this pull request Mar 12, 2021
* Add new GMT_THEME default setting

This will take the name of a separate .conf file that will override the current settings.

* Update names

* Create darkmode.conf

* Wrap up theme machinery

* Update gmt.conf.rst

* Update darkmode.conf

* Play with modern.conf

* Trial modern.conf

* Address comments

* use AvantGarde font

* Bold titles

* Update modern.conf

* Update modern.conf

* Implement auto scaling

* Update modern.conf

* Update gmt_plot.c

* Update gmt_map.c

* smaller offsets

* Let modern have modern defaults

* Update modern.conf

* Updates

* Leave gridlines black and lines with butt cap

* Update inverse and darkmode to be modern

* Move the auto-font-size function to gmt_init.c

* Allow --PAR-value overrides for auto scaling

* Update gmt_init.c

* Improve scripts in general

* Update scripts and fix internals

* Eliminate unneeded gmt set calls

* Update gmt_init.c

* Update gmt_init.c

* Use auto <--> NaN in gmt.conf parsing

* Update gmt_init.c

* Use NaN for undefined font size as well

* Eliminate unneeded MAP_AUTO_SCALE

* Update docs

* Update subplot.c

* Update psscale.c

* update undefined defaults at end of GMT_Parse_Common

That is when we are done parsing any --PAR=value options

* Fix subplot with WrStZ defaults under modern

HEre, if we have W and a panel should not be annotated and w is not selected, then it should be l if either W or l is in the defaults.  Some with b of S or b is in the default.

* Let MAP_ANNOT_MIN_SPACING join the auto-scaled items

Nominally 36p, it now is auto and will scale with the primary fontsize.

* Do not let gmtset expand auto to anything

* Fix vector shape init

* protect sides in psscale.

The resetting interfered with auto-annotation of colorbars.

* Update gmt_init.c

* Fix pstext to initialize default font

* Forgot to update the theme in gmtinit_conf_modern_override (#3508)

This function is called when modern theme is selected in classic or always in modern.  But it failed to actually set the GMT_THEME variable so in classic mode it reverted to classic before writing out the theme.

* Lengthen ticks and slightly increase font size

* Fix multiple addition of frame width

* Update gmt_init.c

* Update gmt_init.c

* Update inverse.conf

* Update gmt_init.c

* Fix auto setting for MAP_FRAME_WIDTH

* Update modern theme and add minimal theme (#4596)

* Change modern default MAP_FRAME_TYPE to fancy

* Make Helvetica default font for modern theme

* Remove return from gmtinit_conf_modern_override

* Fix typo

* Add minimal theme

* Make modern font heading and title bold

* Remove unfinished themes darkmode, inverse, movie

* Update doc/rst/source/gmt.conf.rst

Co-authored-by: Meghan Jones <[email protected]>

* Update src/gmt_init.c

Co-authored-by: Meghan Jones <[email protected]>

* Update doc/rst/source/cookbook/features.rst

Co-authored-by: Dongdong Tian <[email protected]>

* Update doc/examples/ex41/ex41.sh

Co-authored-by: Dongdong Tian <[email protected]>

* Remove MAP_ANNOT_MIN_SPACING auto-scaling (#4704)

* Update doc/scripts/GMT_TM.sh

* Add auto-scaling for new subtitle font as well

* Testing a GMT_THEME off solution (#4710)

* Testing a GMT_THEME off solution

Goal is to allow suers to override specifics in the theme settings without having the THEME be parsed again and overwrite the changes

* Update gmt_init.c

* Themes autoaxes (#4715)

* Aadd auto mode for GMT_MAP_AXES

The default choice may need to depend on view-angle, if azimuthal or cylindrical, etc.

* Handle polar and rotated schemes

* Update gmt_init.c

* Subplot axes (#4720)

* Better interplay between -S and MAP_FRAME_AXES

WHen -S is used for rows or cols then we should let it do its thing, not parse MAP_FRAME_AXES.  If not set then we do.

* Deal with subplot-specific gmt.conf settings

Must create a gmt.conf for a subplot if modern theme so that all fonts etc will be the same across all panels.

* Progress on auto axes and subplots

* COmments

* Fix delayed get_scale calls

* Update pslegend.c

* Update pslegend.c

* Update psscale.c

* Update pslegend.c

* Update GMT_legend.sh

* Use geometric mean of plot dimensions for reference, and delete temp files

* Allow testing of classic only via -DNO_THEMES

* Update gmt_map.c

* Update documentation for gmt themes (#4717)

* List all parameters alphabetically

* Start descriptions for themes and auto settings

* Complete auto scaling documentation

* Add FONT_SUBTITLE to tables

* Fix classic default

* Update auto scaling description

* Fix font settings

* Update FONT_SUBTITLE default

* Update MAP_TICK_PEN_PRIMARY default docs

* Update theme dependent defaults

* Fix a typo

* Format defaults documentation

* Move theme-settings to separate docs page

* Update auto scaling links

* Update auto scaling documentation

* Link themes table to gmt.conf keywords

* Add more links between auto, gmt.conf, and themes

* Fix formatting

* Update MAP_ANNOT_MIN_SPACING default

* Format doc/rst/source/cookbook/features.rst

* Update auto-scaling docs for unknown dimensions

* Update doc/scripts/GMT_dir_rose.sh

* Remove trailing whitespace

* Handle gmt set GMT_THEME classic in a modern session (#4726)

* Handle gmt set GMT_THEME classic in a modern session

Since modern defaults have been set, this PR will flag all the defaults that differ between classic and modern themes so they are updated.

* Update src/gmt_init.c

Co-authored-by: Meghan Jones <[email protected]>

* Update GMT_legend.sh test

* Add NO_THEMES definition to template

* Update GMT_Defaults_1b.sh test

* Update position for anim02.sh

* Update TMcontours.sh test

* Init frame_width before using it to init tick length

Fixes the problem with sphareacentroid.sh and possibly others

* Add auto scaling for MAP_ANNOT_MIN_SPACING

* Auto for MAP_POLAR_CAP (#4854)

* Let POLAR_CAP be auto under modern mode

* Update and add docs

* Update themes.conf files

* Add comments

* Update docs for MAP_POLAR_CAP=auto

Co-authored-by: Meghan Jones <[email protected]>

* Setup map before histogram autolegend

* Explore separate MAP_ANNOT_OBLIQUE settings for oblique and other projections (#4890)

* Explore separate MAP_ANNOT_OBLIQUE settings for oblique and other projections

This PR to be merged into gmt-themes sets MAP_ANNOT_OBLIQUE to be lon_horizontal,lat_horizontao,tick_extend but will reset this to the previous default anywhere unless the user manually changed the setting.

* UPdate

* Reset map_annot_oblique_set when we reset settings

* Update gmt_init.c

* Update gmt_init.c

* Update subplot tests

* Change warnings to debug messages

* Improve spacing for anim05.sh

* Use consistent font size for ex49.sh

* Update share/themes based on gmt_init.c

* Update gmt.conf.rst

* Update gmt-themes docs

* Update PS files for -B scripts

* Add cookbook theme

* Set GMT_THEME=cookbook for doc/scripts

* Update PostScript tests

* Update failing test

* Update failing test

* Update postscript files

* Update failing tests

* Update GMT_cycle_1.sh

* Update symbol_orientation PS files

Both differ from origs but are good. Origs updated.

* Update ps for ex23 and ex49

Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants