Repository navigation
Description
Description of the problem
When using a plot subtitle via -B+t+s the annotation color FONT_ANNOT black gets ignored and the annotation is colored in MAP_FRAME_PEN. This seems only true for FONT_ANNOT black. All other colors get honored.
When using -B+t, FONT_ANNOT black and MAP_FRAME_PEN green everything works as expected:
The same as above but now with an additional subtitle -B+t+s:
Observe how the map annotations became the color of MAP_FRAME_PEN instead of black. When doing the same with another color than black, e.g. FONT_ANNOT red, everything works as expected:
Full script that generated the error
#!/usr/bin/env bash
### FAILS - black, subtitle ###
gmt begin black_subtitle png
gmt basemap -R-24.46/-23.99/16.45/16.72 -Jm1:800000 -Bga \
-B+t"FONT_ANNOT black"+s"I'm a Subtitle" \
--FONT_ANNOT=black \
--MAP_FRAME_PEN=green
gmt end show
### WORKS - black, no subtitle ###
gmt begin black_no_subtitle png
gmt basemap -R-24.46/-23.99/16.45/16.72 -Jm1:800000 -Bga \
-B+t"FONT_ANNOT black" \
--FONT_ANNOT=black \
--MAP_FRAME_PEN=green
gmt end show
### WORKS - red, subtitle ###
gmt begin red_subtitle png
gmt basemap -R-24.46/-23.99/16.45/16.72 -Jm1:800000 -Bga \
-B+t"FONT_ANNOT red"+s"I'm a Subtitle" \
--FONT_ANNOT=red \
--MAP_FRAME_PEN=green
gmt end show
### WORKS - red, no subtitle ###
gmt begin red_no_subtitle png
gmt basemap -R-24.46/-23.99/16.45/16.72 -Jm1:800000 -Bga \
-B+t"FONT_ANNOT red" \
--FONT_ANNOT=red \
--MAP_FRAME_PEN=green
gmt end show
Actual outcome
Map annotations become the color of the map frame if the color for map annotations is set to black and a subtitle is added. Map annotation colors other than black are honored.
Expected outcome
I expect the map annotations in the defined color regardless of subtitle.
System information
- Operating system: Linux
- GMT version (
gmt --version): 6.2.0rc1



Activity
maxrjones commentedon Apr 20, 2021
Thanks for posting @KristofKoch, I will look into this now.
maxrjones commentedon Apr 22, 2021
@PaulWessel, the gsave/grestore block on L6197 - L6255 in
src/gmt_plot.cdoes not seem to work well for isolating changes associated with subtitles. I have not been able to figure out a solution other than not adding theVandUto the postscript file, which I suspect would cause other issues.PaulWessel commentedon Apr 23, 2021
Sorry preoccupied. Will start on this later this pm.
Ensure font/stroke color is reset internally
Ensure font/stroke color is reset internally (#5170)