Am rewriting my codes in Modern Mode and I can’t find the equivalent tricks to some classic commands.
I like to compile some group of figures into a single pdf Classic:
Is there a way to do that in Modern without having to create, merge and delete multiple pdfs? If there’s really no other solution… then how ?
Modern:
gmt begin
gmt figure Fig1
[…layer 1 and 2…]
gmt figure Fig2
[…layer 3 and 4…]
gmt end
~# a command to append Fig2 to Fig1 into Fig3 ?
merge Fig1 Fig2 > Fig3
rm -f Fig1 Fig2
There are several things one cannot esaily to in modern that gurus could do in classic. For instance, if you want to reuse a PostScript layer in many plots one could just make the layer separate:
gmt command-or-script … -O -K > common.ps
and then just use cat common.ps >> Fig1.ps, cat common.ps >> Fig2.ps, etc and do whatever. With you no longer having access to the PostScript low-level files you cannot do things that way anymore.
Likewise, GMT never really supported multi-page documents since plots are inherently a single page.
For an example of how you can do this in modern mode, see the last example on the gmt batch documentation where we create lots of PDF plots in parallel and then merge into a single PDF document.
Interesting, we certainly never read PDF files internally so I am surprised that works, but perhaps it does because with -TF we just pass the filenames to gs in this case.