As this blog is to serve as a useful record for myself as well as for other astronomers, it has to start with exactly what I'm doing right now, which happens to be rather unfortunately mundane for a first post: constructing multi-panel figures using supermongo.
The basic reference for supermongo is http://www.astro.princeton.edu/~rhl/sm
It's easy to make a figure with multiple panels using separate calls to LOCATION. The full plot area is defined as 0-32767 in supermongo's basic scale units, so for a one-panel plot with plenty of space for axis labels and some space around the outside you could use "LOCATION 4000 32000 4000 32000", which gives you a square plot where both x and y coordinates range from 4000 to 32000. Starting at 4000 gives a wider space around the left side and the bottom, so you can fit axis labels without crowding them. For a plot vertically divided into four panels you could instead use something like:
LOCATION 4000 32000 25000 32000
box
xlabel Time (hours)
ylabel flux
<plotting commands>
LOCATION 4000 32000 18000 25000
box
xlabel Time (hours)
ylabel flux
<plotting commands>
LOCATION 4000 32000 11000 18000
box
xlabel Time (hours)
ylabel flux
<plotting commands>
LOCATION 4000 32000 4000 11000
box
xlabel Time (hours)
ylabel flux
<plotting commands>
This can be used to produce a plot like the following:
There are several problems with this particular plot, however. First, the repeated "Time (hours)" label is annoying. We should have it only on the bottom panel. That is easy: just don't include the xlabel command for any panel except the bottom one. However, since the scale of the x axis is exactly the same in every panel in this case, we should also remove the numerical labels on the x axis for every panel except the bottom one. It turns out that using the command "box 0 2" instead of simply "box" will draw the box with numerical labels only on the y axis (if you want, instead, to label the y axis but not the x axis, use "box 1 0"). Finally, since the y axis represents flux in every case, it isn't necessary to label the y axes of the individual panels. Labelling the y axis just once will also allow for a longer, more descriptive label. I do this by 'fooling' supermongo by using an initial LOCATION command to specify a large, one-panel plot, and putting the y label on that. I also change the starting x location to 4500 in every case, to avoid crowding the new y axis label. The edited set of commands then becomes:
LOCATION 4500 32000 4000 32000
ylabel Normalized flux
LOCATION 4500 32000 25000 32000
box 0 2
<plotting commands>
LOCATION 4500 32000 18000 25000
box 0 2
<plotting commands>
LOCATION 4500 32000 11000 18000
box 0 2
ylabel flux
<plotting commands>
LOCATION 4500 32000 4000 11000
box
xlabel Time (hours)
<plotting commands>
And the result is:
Which looks basically satisfactory. One additional trick which I used even in the first plot is to make sure the y axis ranges don't end on major tickmarks. Otherwise numerical y axis labels from the top of one panel will overlap with those at the bottom of the next panel. I set the y (and x) axis ranges using the "limits" command, before each call to box, like this:
limits -0.5 22.5 0.985 1.015
box 0 2
If I had instead used y axis limits of 0.98 1.02, I would have had label overlap issues.
No comments:
Post a Comment