gmt
gmt copied to clipboard
Inset within subplot : -D*anchor* is lost
Inset not taking into account the subplot
environment:
gmt begin test png
gmt subplot begin 3x1 -Fs5c -R0/1/0/1
gmt subplot set
gmt basemap -Bafg
gmt subplot set
gmt basemap -Bafg
gmt subplot set
gmt basemap -Bafg
gmt inset begin -DJTR -Rg -JG0/-90/1c -F+gred
gmt basemap -Bafg
gmt inset end
gmt inset begin -DJTR+o1c -Rg -JG0/-90/1c -F+gblue
gmt basemap -Bafg
gmt inset end
gmt subplot end
gmt end show
On the road so cannot check but guessing that 2 insets in a panel is one too many?
I'd say it's a deeper problem (using -Xa
under the hood or something)
I was able to figure out what is going on:
- No projection is defined for subplot. While we know you mean
-JX5c
since you specified a 5x5 cm panel and gave a -R, we do set under the hood somewhere that scaling. But when the inset command starts it needs to save the projection used for the panel in which the inset will be placed. At that point it decides no -J is set and hence defaults to the GMT 15x15c linear projection. So when it applies that we are suddenly 15 cm out and up.
I will see if I can figure out exactly where this happens and if I can intervene to set -JX5c
there instead, but I would have to create that -J string so easier if it already existed via subplot.