Skip to content

Commit f1c04a9

Browse files
PaulWesselMeghan JonesMeghan Jonesseisman
authored
Implement GMT themes (sets of GMT defaults) (#3344)
* 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]>
1 parent bbbcf83 commit f1c04a9

File tree

562 files changed

+1565
-489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

562 files changed

+1565
-489
lines changed

cmake/ConfigUserAdvancedTemplate.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
#add_definitions(-DUSE_COMMON_LONG_OPTIONS) # Turn on testing of upcoming long-option syntax for common GMT options
237237
#add_definitions(-DUSE_MODULE_LONG_OPTIONS) # Turn on testing of upcoming long-option syntax for module options
238238
#add_definitions(-DEXPORT_GMTLIB) # Turn on to access normally un-exported or static gmtlib functions from external tools
239+
#add_definitions(-DNO_THEMES) # Turn off implementation of GMT_THEME for debugging
239240

240241
#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement ${CMAKE_C_FLAGS}") # recommended even for release build
241242
#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}") # extra warnings

doc/examples/anim01/anim01.ps

1.25 KB
Binary file not shown.

doc/examples/anim02/anim02.ps

1.17 KB
Binary file not shown.

doc/examples/anim02/anim02.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ cat << EOF > main.sh
2424
gmt begin
2525
width=\$(gmt math -Q \${MOVIE_WIDTH} 0.5i SUB =)
2626
gmt grdimage topo.nc -I+a\${MOVIE_COL0}+nt2 -JM\${width} -Cmain.cpt \
27-
-BWSne -B1 -X0.35i -Y0.3i --FONT_ANNOT_PRIMARY=9p
27+
-BWSne -B1 -X0.4i -Y0.3i --FONT_ANNOT_PRIMARY=9p
2828
gmt plot -Sc0.8i -Gwhite -Wthin <<< "256.25 35.6"
2929
gmt plot -Sv0.1i+e -Gred -Wthick <<< "256.25 35.6 \${MOVIE_COL1} 0.37i"
3030
gmt end
3131
EOF
3232
# 3. Run the movie
33-
gmt movie main.sh -C3.5ix4.167ix72 -Nanim02 -Tangles.txt -Sbpre.sh -D6 -Zs $opt
33+
gmt movie main.sh -C3.7ix4.167ix72 -Nanim02 -Tangles.txt -Sbpre.sh -D6 -Zs $opt

doc/examples/anim03/anim03.ps

1.05 KB
Binary file not shown.

doc/examples/anim05/anim05.ps

1.54 KB
Binary file not shown.

doc/examples/anim05/anim05.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cat << EOF > main.sh
2222
gmt begin
2323
let k=\${MOVIE_FRAME}+1
2424
gmt greenspline @Table_5_11.txt -R0/6.5/0/6.5 -I0.05 -Sc -Gt.nc -Z1 -Cn\${k} -Emisfit.txt
25-
gmt grdcontour t.nc -C25 -A50 -Baf -BWsNE -JX4i -Gl3.6/6.5/4.05/0.75 -Xc -Y0.4i
25+
gmt grdcontour t.nc -C25 -A50 -Baf -BWsNE -JX4i -Gl3.6/6.5/4.05/0.75 -Xc -Y0.6i
2626
gmt plot misfit.txt -Ct.cpt -Sc0.15c -Wfaint -i0,1,4
2727
printf "%2.2d" \$k | gmt text -F+cTR+jTR+f18p -Dj0.1i -Gwhite -W0.25p
2828
gmt colorbar -Ct.cpt -DJBC+e -Bxaf -By+l"misfit"

doc/examples/ex01/ex01.ps

-2.28 KB
Binary file not shown.

doc/examples/ex01/ex01.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# GMT EXAMPLE 01
33
#
44
# Purpose: Make two contour maps based on the data in the file osu91a1f_16.nc
5-
# GMT modules: set, subplot, grdcontour, coast
5+
# GMT modules: subplot, grdcontour, coast
66
#
77
gmt begin ex01
8-
gmt set MAP_GRID_CROSS_SIZE_PRIMARY 0 FONT_ANNOT_PRIMARY 10p
98
gmt subplot begin 2x1 -A -M0.5c -Blrtb -Bafg -T"Low Order Geoid" -Fs16c/0 -Rg -JH16c
109
gmt coast -JH? -Glightbrown -Slightblue -c0,0
1110
gmt grdcontour @osu91a1f_16.nc -C10 -A50+f7p -Gd10c -Ln -Wcthinnest,- -Wathin,- -T+d8p/2p+l

doc/examples/ex02/ex02.ps

170 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)