next up previous contents
Next: 4.2 Example 1: Using Up: 4. Using frames Previous: 4. Using frames

   
4.1 Introduction

Frames enable KUPLOT to display multiple view graphs within a single plot. The layout is defined by the user. A simple example with two graphs being plotted on a single page is shown in Figure 4.1. Let us have a look at the macro file that was used to create the figure and learn step by step how to use this feature of KUPLOT. Note that the line numbers shown in the listing below are used for easy reference in this manual and are not part of the actual macro file.


  
Figure 4.1: Simple example using frames
\includegraphics[scale=0.5, angle=270.0]{fra.1.eps}

     1  load xy,s287.xy
     2  load xy,s288.xy
     3  #
     4  tit1 Experiment A
     5  achx \gw (\uo\d)
     6  achy Counts
     7  mark 0.1,100
     8  buff 0.08
     9  fnam off
    10  fram on
    11  #
    12  nfra 2
    13  #
    14  afra 1
    15  kfra 1,1
    16  tit2 Scan 287
    17  #
    18  afra 2
    19  kfra 2,2
    20  tit2 Scan 288
    21  #
    22  plot

The macro starts with the reading of two data sets (lines 1-2). Next title, axes labels and marker intervals are set (lines 4-7) as in previous examples. The command 'buff' (line 8) alters the space around the view graph reserved for axis numbering and titles. The value is the fraction of the total width or height of the plot. In our case we reserve 8% of the page on all four sides of the plot as buffer space. In line 9 the plotting of the filename is disabled and in the following line the plotting of a border around each frame is enabled. So far we have used no frame related commands and a plot at this stage would show both data sets in a single view graph. In line 12 we then specify that we want to use two frames, i.e. have two view graphs on our plot. At this stage, all settings from the current plot (fram 1 in case we have used frames before) are copied as defaults to all other frames. Entering command 'plot' now would result in two equivalent view graphs side by side on the plot. Thus all setting that are common to all frames should be made before the command 'nfra' is used. Now we need to customize the two frames. The command 'afra' determines for which frame the following commands are used. First we alter settings for frame 1 by entering 'afra 1' (line 14). Next we specify that this frame should only contain the data from data set one (line 15) and we enter an individual second title line (line 16). The same procedure is repeated for frame 2 (lines 18-22) which should include data set 2 and a different subtitle line. The command 'plot' (line 22) will result in a picture similar to the one in Figure 4.1.


 
Table 4.1: KUPLOT commands related to frames
Command Description
afra Sets the active frame for user input
bfra Sets background colour for specified frame
cfra Copies frame parameters
fram Defines if a border is plotted around each frame
kfra Defines contents of frames (data sets or text)
nfra Sets number of frames (default = 1)
sfra Defines position and size of a frame

The usage of frames is rather simple and most KUPLOT settings are individual settings for the different frames. All frame related commands are summarized in table 4.1. The following two sections contain more complex examples using frames. Additionally the interactive tutorial (see section 1.4) gives a further inside into the usage of frames.


next up previous contents
Next: 4.2 Example 1: Using Up: 4. Using frames Previous: 4. Using frames
Thomas Proffen {Billinge}
1999-06-26