C-PLOT

Scientific Graphics and Data Analysis

E.1.2. - Error-bar, line-control and orientation modes



Error-bar, line-control and orientation modes can be turned on or off, or you can determine if they are already on or off, with these macros. Within the plot program, the commands eb, lc and tu control these modes.

 Name   What it Does 
 xb_on()   Turn x error-bar mode on 
 xb_off()   Turn x error-bar mode off 
 is_xb()   Value is nonzero if x error-bar mode is on 
 yb_on()   Turn y error-bar mode on 
 yb_off()   Turn y error-bar mode off 
 is_yb()   Value is nonzero if y error-bar mode is on 
 z_on()   Turn z error-bar mode on 
 z_off()   Turn z error-bar mode off 
 is_zb()   Value is nonzero if z error-bar mode is on 
 lc_on()   Turn line-control mode on 
 lc_off()   Turn line-control mode off 
 is_lc()   Value is nonzero if line-control mode is on 
 tu_on()   Turn portrait mode on 
 tu_off()   Turn portrait mode off (plot in landscape mode) 
 is_tu()   Value is nonzero if portrait mode is on 




These macros set the current plotting symbol and create or modify the symbol and text in the key. The commands sy and gk perform the same function within the plot program.

 Name   What it Does 
 set_sym(sym  Assign code in sym to plotting symbol 
 set_key(i, sym, s  Assign ith line of the key the symbol sym and the string s 

The symbol is coded in the low-order 16 bits of an (unsigned) integer. In the following description, these bits are numbered from 0 to 15, with bit 0 being the least significant (ones) bit.

If bit 7 is set, the code is for a line symbol and bits 0-6 contain the ASCII value of the corresponding upper-case letter.
set_sym(0x80|'L');      /* Solid line */
set_sym(0x80|'A');	/* Dotted line */
If some of bits 0-6 are set but none of bits 8-14, the code contained in bits 0-6 is one greater than the corresponding code for one of the special symbols.
set_sym(1+0);   /* Code 0, an open circle */
set_sym(1+23);	/* Code 23, a palm tree */
If some of bits 8-14 are set but none of bits 0-6, the code contained in bits 8-14 (shifted down 8 bits) is the ASCII value of the character to be used as the symbol.
set_sym('+'<<8);        /* A plus sign */
set_sym('X'<<8);        /* An upper-case x */
If both some of bits 0-6 and some of bits 8-14 are set, the two ASCII characters represented are the two-letter code for one of the special characters used by C-PLOT.
set_sym('*'|'a'<<8);    /* The \(*a, alpha character */
set_sym('d'|'d'<<8);    /* The \(dd, double dagger */

Finally, when assigned to a symbol used in the key, if bit 15 is set, the program pauses when drawing the key on a pen plotter to allow the user to change pens. (See the c option in gk.)

The set_key() macro can be used to assign each element of the key. The second argument contains the coded symbol using the conventions described above. The second argument should be set to zero to mark the last element of the key.
set_key(0, 1+0, "Data");        /* 0, open circle */
set_key(1, 0x80|'L', "Fit";     /* 'L', solid line */
set_key(2, 0, ");              /* mark end with sym=0 */
The manifest constant KEY_LEN is defined to be the maximum length of the key labels (including the terminating null byte). The constant NUMKEYS is the number of key entries allowed. If using all NUMKEYS entries, it is not necessary to mark the last entry with a null symbol.