next up previous contents
Next: Trace Picking Utilities Up: Additional PostScript Support Previous: PSBBOX - Changing the   Contents

PSMERGE, MERGE2, MERGE4 - Merging PostScript Plots

It is often useful to merge several plots to make a compound figure. The program psmerge is the general tool in SU provided for this. There are two additions shell scripts, which call psmerge called merge2 and merge4. If we make a couple of test datasets

% suplane > junk.su
% suplane | sufilter > junk1.su
and display these by various means
% supswigb < junk.su title="Wiggle trace" label1="sec" label2="trace number" > junk1.eps
% supsimage < junk.su title="Image Plot" label1="sec" label2="trace number" > junk2.eps
% supscontour < junk.su title="Contour Plot" label1="sec" label2="trace number" > junk3.eps
% supswigb < junk1.su title="Filtered" label1="sec" label2="trace number" > junk4.eps
we now have 4 PostScript files which can be merged to make new plots.

Merging 2 plots may be done via:

% merge2 junk1.eps junk2.eps > junk.m2.eps
while merging all 4 plots may be done via
% merge2 junk1.eps junk2.eps junk3.eps junk4.eps > junk.m4.eps
Of course, neither merge2 nor merge4 are robust enough to handle all plot sizes, so you may need to manually merge plots with psmerge. Also, if you want to overlay plots, such as a graph on top of a wiggle trace plot, then you will also need to use psmerge.

Here is an example of creating plots and merging them with psmerge. Because the command sequence is ungainly for typing on the commandline it is expressed as a shell script

#! /bin/sh
# shell script for demonstrating PSMERGE

# make data
suplane > junk.su
suplane | sufilter > junk1.su

# make PostScript Plots of data
supswigb < junk.su wbox=6 hbox=2.5 \
 title="Wiggle trace" label1="sec" label2="traces" > junk1.eps
supscontour < junk.su wbox=2.5 hbox=2.5  \
 title="Contour Plot" label1="sec" label2="traces" > junk3.eps
supswigp < junk1.su wbox=2.5 hbox=2.5 \
 title="Filtered" label2="traces" > junk4.eps

# merge PostScript plots
psmerge in=junk1.eps translate=0.,0. \
 in=junk3.eps translate=0.0,3.7 \
 in=junk4.eps translate=3.3,3.7 > junk5.eps

echo "You may view the files: junk1.eps, junk3.eps, junk4.eps, junk5.eps"
echo "with your PostScript Previewer"

exit 0
In this case, the original files were made small to fit within an 8-1/2'' by 11'' window. However, psmerge has the capability of scaling plots. (This is how the merge2 and merge4 shells work. You can examine the texts of these for further information by typing
% more $CWPROOT/bin/merge2
or
% more $CWPROOT/bin/merge4
An additional example of merging 3 plots of different sizes is given by the following shell script
#! /bin/sh
# shell script for demonstrating PSMERGE

# make data
suplane > junk.su
suplane | sufilter > junk1.su

# make PostScript Plots of data
supswigb < junk.su wbox=7 hbox=4 \
 title="Wiggle trace" label1="sec" label2="traces" > junk1.eps
supscontour < junk.su \
 title="Contour Plot" label1="sec" label2="traces" > junk3.eps
supswigp < junk1.su label1="sec" \
 title="Filtered" label2="traces" > junk4.eps

# merge PostScript plots
psmerge in=junk1.eps translate=0.,0. scale=.6,.6 \
 in=junk3.eps scale=.4,.4 translate=0.0,3.7 \
 in=junk4.eps scale=.4,.4 translate=3.3,3.7 > junk5.eps

echo "You may view the files: junk1.eps, junk3.eps, junk4.eps, junk5.eps"
echo "with your PostScript Previewer"

exit 0

In this case, the plots are of normal size, and are then scaled to fit within an 8-1/2'' by 11'' window.


next up previous contents
Next: Trace Picking Utilities Up: Additional PostScript Support Previous: PSBBOX - Changing the   Contents
John Stockwell 2007-04-10