(BioCompanion v3.5)

PLOTTER

Documentation in postscript

 
	

location: Home > Archive > PLOTTER (1999)


Section 1-5: EXAMPLE 5 - various data sets from different files

Copyrighted material. See the Internet BioCompanion Home Page for further information.

[ Previous chapter ][ This chapter ][ Next chapter ] As mentioned in the basic command documentation , PLOTTER may use different files for its input. In this case, PLOTTER does no longer use the file parameter of its commandline input to seek for the steering file but the steering file IS the commandline argument. The disadvantage of this procedure turns out to be a benefit: PLOTTER does no longer "know" the input filename and can, therefore, use different input files.

We now proceed to this rather sophistication operation and will process more than one data file.


Subsection 1.5.1

Starting material

We use our example file ( data (example5a.dat, example5b.dat) for this purpose:

 
  
Example data 5a of PLOTTER tutorial |Example data 5b of PLOTTER tutorial   
<Xaxis    ><Y1 >< Y2 >              |<Xaxis    ><Y1 >< Y2 >  
Monday       3    22.5              |Monday       8    10.3  
Tuesday      3    9.4               |Tuesday      3    13.5  
Wednesday    7    30.2              |Wednesday    6    57.6  
Thursday    11    48.7              |Thursday     7    64.3  
Friday       4    16.2              |Friday      11    20.4  
Saturday     4     9.4              |Saturday     2    15.1  
Sunday       5    2.3               |Sunday       5    9.4  
In this example we will work with the <Y1> values only.


Subsection 1.5.2

Initial steering file

We start with the following file ("example5.str") as a start:

 
%PLOTTER                                 Label for steering file   
GLOBAL                                   Global section here   
DIMENSION 200 400                        Dimension 200 by 400 pixel   
TITLE Multiple input data                Title tag   
XLEGEND Day of the week                  Some X label   
YLEGEND Number/duration of uses          Some Y label   
LOCAL                                    FIRST local statement   
INFILE example4.dat                      select example4.dat as input   
XVALUE 1 4                               parse X (Note - 3 letters only!)   
YVALUE 12 15                             parse Y   
XAXIS VALUES 8 1                         X axis has 8 values; interval of 1  
YAXIS 0 12 2                             Y axis from 0 to 12, interval 2  
COLOR RED                                paint the curve red   
GOLINE 2                                 plot a line   
LOCAL                                    SECOND local statement   
INFILE example5a.dat                     select example5a.dat as input   
XVALUE 1 4                               |  
YVALUE 12 15                             |  
XAXIS VALUES 8 1                         | same values as in first local  
YAXIS 0 12 2                             |  
COLOR BLUE                               paint the curve blue   
GOLINE 2                                 plot a line   
END                                      END   


Subsection 1.5.3

More file input

Like the second, we may now add the third, fourth, etc. data set by adding more LOCAL sections. It does not matter whether we respecify the same file or take a different file name. The number of files is unlimited. Keep in mind, owever, that the plot might get crowded easily.

For this example, we add a third data file ( example5b.dat ) and will now have three curves: a red, blue, and a magenta line. Despite the fact that we used different colors, the plot becomes crowded! Therefore, we insert a

RENDITION DASHED

statement in front of the blue line, and a

RENDITION DOTTED

statement before the magenta line.


Subsection 1.5.4

Legends for the curves

Still, we do not know dfrom the plot which line originated from which color. Therefore, we add a LEGEND statement to the GLOBAL section that reserves space for the legend,

LEGEND 3

and will then use the LEGEND statement again in each LOCAL section to indicate the legend for the curve in question:

LEGEND example4.dat

(Similarly, proceed for example5a.dat and example5b.dat).

NOTE

LEGEND statements must be directly after the DIMENSION in the GLOBAL section, and directly before the GOLINE in the LOCAL section.

LEGEND statements are oprional (ii.e. may be onitted).


Subsection 1.5.5

Considerations

The TITLE statement is always centered regardless how many legends are displayed. However, in titles, blanks are used in the calculation. If we, therefore, write

 
TITLE           Multiple input data  
we will have a title that starts with several blanks and therefore is shifted to the right in the plot. This is useful if the title lettering conflicts with the Y axis.

If many points are used, renditions become useless as the lines are too short to see the dot schemata, then, even dashed lines get displayed as solid lines.


Subsection 1.5.6

Result steering file

example5.str

 
%PLOTTER                                 A comment here   
GLOBAL                                   Global section here   
DIMENSION 200 400                        Dimension 200 by 400 pixel   
LEGEND 3  
TITLE           Multiple input data                  
XLEGEND Day of the week  
YLEGEND Number/duration of uses  
LOCAL                                    FIRST local statement   
INFILE example4.dat                      select example4.dat as input   
XVALUE 1 4                               parse X (Note - 3 letters only!)   
YVALUE 12 15                             parse Y   
XAXIS VALUES 8 1                         X axis has 8 values; interval of 1  
YAXIS 0 12 2                             Y axis from 0 to 12, interval 2  
COLOR RED                                paint the curve red   
LEGEND example4.dat  
GOLINE 2                                 plot a line   
LOCAL                                    SECOND local statement   
INFILE example5a.dat                     select example5a.dat as input   
XVALUE 1 4                               |  
YVALUE 12 15                             |  
XAXIS VALUES 8 1                         | same values as in first local  
YAXIS 0 12 2                             |  
RENDITION DASHED                         ---- ---- ----   
COLOR BLUE                               paint the curve blue   
LEGEND example5a.dat  
GOLINE 2                                 plot a line   
LOCAL  
INFILE example5b.dat                     select example5b.dat as input   
XVALUE 1 4                               |  
YVALUE 12 15                             |  
XAXIS VALUES 8 1                         | same values as in first local  
YAXIS 0 12 2                             |  
RENDITION DOTTED                         ........  
COLOR MAGENTA                            paint the curve blue   
LEGEND example5b.dat  
GOLINE 2                                 plot a line            
END                                      END   

Reference:example5.gif

Reference:example5.str

Reference:example5a.dat

Reference:example5b.dat


[next page] , or [overview] , or [table of contents]

Copyrighted material. See the Internet BioCompanion Home Page for further information.