I want to plot a column of data in Mollweide projection, and another column in orthographic projection. My idea was to use subplot to define a fixed size of each subpanel, and then use two different subplot commands to change projections. My code is below. The problem is that the rows don’t align correctly. Please advise if you can spot the problem.
When I remove the -J option from the subplot begin command, I get this error:
plot [ERROR]: Could not parse -nan into Geographical, Cartesian, or Temporal coordinates!plot [ERROR]: Option -R parsing failure. Correct syntax:
-R///[//]
Append +r if giving lower left and upper right coordinates
-Rg or -Rd for global domain
-R to take the domain from a grid file
plot [ERROR]: Offending option -R0/3/0/-nan
I feel the issue here is that both the panel size (via -Fs as 3i/3i) and the sizes of the maps (18c for the Mollwide projections of the first 2x2 supblot and 4c for the Orthographic projections of the second 2x2 subplot) are given. As already mentioned by @PlanetGus it is not needed to give -R and -J within the subplot begin line, but you can set both for each panel separately. As far as I know, in subplot mode, you have to use a ? for the size of the map or projection. Maybe you can use the basic code example below as orientation and expand it for your needs (maybe -Fs3i/1.5i looks nicer).
Code example:
gmt begin
gmt subplot begin 2x2 -Fs3i/3i
gmt subplot set 0,0
gmt basemap -Rg -JW180/? -B
gmt subplot set 1,0
gmt basemap -Rg -JW180/? -B
gmt subplot set 0,1
gmt basemap -Rd -JG0/90/? -B
gmt subplot set 1,1
gmt basemap -Rd -JG0/90/? -B
gmt subplot end
gmt end show
Thank you all for taking the time to help me with this. Upgrading to 6.4.0 was important (I was using 6.2.0). I took yvonne’s example and tried to go a bit further to what I want to eventually have, which is a 2x3 grid with Mollweide, ortho, ortho. I tried the suggestion of -Fs3i/1.5i which seems to have nicer proportions, however now there is quite a lot of horizontal whitespace:
gmt begin
gmt subplot begin 2x3 -Fs3i/1.5i -M0.5c/0.5c
gmt subplot set 0,0
gmt basemap -Rg -JW180/? -B
gmt subplot set 1,0
gmt basemap -Rg -JW180/? -B
gmt subplot set 0,1
gmt basemap -Rd -JG0/90/? -B
gmt subplot set 1,1
gmt basemap -Rd -JG0/90/? -B
gmt subplot set 0,2
gmt basemap -Rd -JG0/90/? -B
gmt subplot set 1,2
gmt basemap -Rd -JG0/90/? -B
gmt subplot end
gmt end show