In this section we will learn how we can create plots where several viewgraphes share one or more sides. This is done using the command 'buff' we have used in the first part of this chapter. An example plot is shown in Figure 4.3.
The macro used to create the plot is displayed below. As usual we start resetting KUPLOT (line 1) and we select portrait orientation for this plot (line 2). Next the data sets are loaded (lines 4-7). This is followed by general settings (lines 8-12) since all our frames will have the save y-axis label, plot window and tick mark interval.
1 rese
2 orient port
3 #
4 load xy,tot.calc
5 load xy,dif_ga.calc
6 load xy,par_ga.calc
7 #
8 fnam off
9 fset 2
10 achy G(r) [\A\u-2\d]
11 skal xmin[1],xmax[1],1.2*ymin[1],1.2*ymax[1]
12 mark 2.0,10.0
Next we define the frames, three on top of each other with no gap in between them. Since the middle frame will have no buffer space on the bottom and top we need to make it smaller in order for the plot area to have the same size. Here we use variables for the task. The value of the buffer size for title and axes labels is stored in 'r[1]' (line 14), here 0.1. The remaining plot space for each panel is calculated and stored in 'r[2]' (line 15). It is simply the full size (1.0) minus two times the buffer size for the title of the top panel and the axis label and numbering of the bottom panel. Next we select three frames (line 17) and set the frame corners using the variables we just defined. The x-range for all panels is 0.0 to 1.0. The y ranges are determined by simply adding the heights of the panels and the buffering space together (lines 18-20). Simply calculate the numbers and it becomes clear.
13 #
14 r[1] = 0.1
15 r[2] = (1.0-2.0*r[1])/3.0
16 #
17 nfra 3
18 sfra 1,0.0,2.0*r[2]+r[1],1.0,3.0*r[2]+2.0*r[1]
19 sfra 2,0.0, r[2]+r[1],1.0,2.0*r[2]+ r[1]
20 sfra 3,0.0,0.0 ,1.0, r[2]+ r[1]
In the next section the setting for the individual frames are entered. Most of the commands were already discussed in the previous chapters. The command 'buff' can either be used with a single parameter like in the example in section 4.1 in which case the buffer space around the view graph is the same in all directions. Alternatively one can supply four parameters for the required free space on the left and right side and the bottom and top of the view graph, respectively. In our example this first frame located on the top will have no buffer space at the bottom (line 23). Apparently we have to turn the numbering for the x-axis off (line 25). Now we repeat the settings for the other two frames. For the middle frame we have no buffer space on the top an bottom (line 29) and for the bottom frame we have only buffer space at the bottom (line 34). Also we need to set a x-axis label for the bottom panel (line 38).
21 #
22 afra 1
23 buff 0.1,0.1,0.0,r[1]
24 kfra 1,1
25 achx OFF
26 sann 1,"total PDF",13.0,10.0,right
27 #
28 afra 2
29 buff 0.1,0.1,0.0,0.0
30 kfra 2,2
31 achx OFF
32 sann 1,"differential Ga PDF",13.0,10.0,right
33 #
34 afra 3
35 buff 0.1,0.1,r[1],0.0
36 kfra 3,3
37 sann 1,"partial Ga PDF",13.0,10.0,right
38 achx r [\A]
Frames are a flexible tool and can be placed anywhere on the plot area and may also overlap. A even slightly more complex example using frames is discussed in the next section.