next up previous contents
Next: 5. Using the mouse Up: 4. Using frames Previous: 4.3 Example 2: Connected

   
4.4 Example 3: Advanced frame usage

The final example for the usage of frames is more complex and the resulting plot is shown in Figure 4.4. KUPLOT is capable of creating quite complex plots and e.g. allows one to create complete transparencies for a talk.


  
Figure 4.4: Advanced frame example plot
\includegraphics[scale=0.75]{fra.4.eps}

The macro used to create the plot is displayed below. As usual the data sets are loaded first (lines 1-2) followed by general settings (line 4). Next we select 4 frames (line 6) and define the desired frame layout (lines 8-11) and individual background colours for each frame (lines 13-15). Note that the default background colour is white. The colours are given as RGB (red, green, blue) values ranging from 0.0 to 1.0.

     1  load xy,test.cut
     2  load ni,test.nipl
     3  #
     4  fnam off
     5  #
     6  nfra 4
     7  #
     8  sfra 1,0.0,0.0,0.5,0.9
     9  sfra 2,0.5,0.4,1.0,0.9
    10  sfra 3,0.5,0.0,1.0,0.4
    11  sfra 4,0.0,0.9,1.0,1.0
    12  #
    13  bfra 2,0.9,0.9,0.9
    14  bfra 3,0.9,0.9,0.9
    15  bfra 4,0.7,0.7,0.7

The next part of the macro file contains the settings for frame 1. After setting the focus to this frame (line 19), data set 1 is selected for this frame (line 20). The following commands specify various settings and were already explained in previous examples. The 'font' command in line 32 increases the font size of all fonts used for this frame by 10%.

    16  #
    17  # Frame 1 with cross section
    18  #
    19  afra 1
    20  kfra 1,1
    21  buff 0.4
    22  lcol 1,6
    23  mtyp 1,3
    24  mcol 1,1
    25  msiz 1,0.2
    26  skal 0.0,3.2,0.0,5000.0
    27  mark 1,1000
    28  achx [h h 1.0]
    29  achy Counts
    30  tit1 Cross section
    31  tit2 l=1.0
    32  font size,1.1

Next we have the settings for frame 2 containing the 2D data set number 2, the diffuse neutron scattering of Ca-CSZ we used as example before. Again the various commands were explained in earlier examples.

    33  #
    34  # Frame 2 with data plot
    35  #
    36  afra 2
    37  kfra 2,2
    38  glat 2,3
    39  hart 2,3
    40  hcol 2,1,3
    41  hlin 1,100,50,12
    42  mark 1,1,0,0
    43  aver 0.707
    44  achx [h h 0]
    45  achy [0 0 l]
    46  tit1 Diffuse scattering
    47  tit2 Ca-CSZ
    48  font size,1.1

The next frame contains text rather than data. The text for this frame is read from the file 'ref.txt' which contains exactly the text you can see at the bottom right corner of the plot in Figure 4.4. In lines 52-56 the justification of the text, the font type and font size are specified. The text file may contain the same special characters and control sequences discussed in section 2.3.

    49  #
    50  # Frame 3 with text
    51  #
    52  afra 3
    53  kfra 3,ref.txt
    54  font just,left
    55  font typ,5,1
    56  font siz,5,12

Finally we specify another text file containing the title line of the plot. We select the text to be centered (line 62) and set the font to 'italics' (font 3), set the colour to dark red (pen 7) and increase the size of the font to 24 points.

    57  #
    58  # Frame 4 with title text
    59  #
    60  afra 4
    61  kfra 4,tit.txt
    62  font just,center
    63  font typ,5,3
    64  font col,5,7
    65  font siz,5,24

Currently one has not much control about the layout in a frame containing text but that might change in future version of the program KUPLOT.


next up previous contents
Next: 5. Using the mouse Up: 4. Using frames Previous: 4.3 Example 2: Connected
Thomas Proffen {Billinge}
1999-06-26