Set log scale in subplots with figure size undetermined

Hi all,

I was trying to plot a figure with varying number of subplots, in which I specify the subploot size by JX?. In the last row of these subplots, I need use log scale in yaxiss, which seems to only support something like “JX4c/3cl” rather than “-JX?/?l”

Not all subplots are of the same size, so creating subplots with fixed size fs4c/3c won’t work for me, instead I have, e.g., -Ff9c/6c+f1/3,3,2.

Even though there are 3 * 3 subplots, the width of each subplot is not simply “9 / 3 = 3c”, nor the height of the last row is “6 / (3 + 3 + 2) * 2 = 1.5c”

For example,

gmt begin test png
  gmt subplot begin 3x3 -Ff9c/6c+f1/3,3,2 -M0c/0c -A+o-0.3c/-0.1c
  gmt subplot set 8 -A'(i)'
    gmt basemap -R0/100.0/0.05/60.0 -JX3c/1.5cl -Bbltr+n
    gmt plot -Sc0.02c -Gblack -BWStr << EOF
1 1
90 20
EOF
  gmt subplot end
gmt end

This will generate something with an extra outer frame, like:
image

I was wondering how to specify arguments for -JX option in this case to get a logarithm scale yaxis?

Thanks!

Variable numer of panels per row is not supported (yet). You can mess with -J to some extent but no guarantees. One option to consider if the rows differ is to plot several subplots, one for each row, and then move the plot focus up using -Yh. That may work better.

As for log axis. Our test suite has examples, e.g. test/modern/powlog.sh, so using questionmarks should work:

gmt begin powlog
  gmt subplot begin 2x2 -Fs3i -M5p -A -SCb -SRl -Bwstr -R1/100/0/100
    gmt basemap -JX?l/?p0.5
    gmt basemap -JX?l/?p0.5 -c
    gmt basemap -R0/100/1/100 -JX?p0.5/?l -c
    gmt basemap -R0/100/1/100 -JX?p0.5/?l -c
  gmt subplot end
gmt end show