.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>ploticus: ploticus variables</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>Ploticus variables</h2></td>
  <td align=right>
  <small>
  <a href="../doc/welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  Version 2.33 Jun'06
     </small><br><a href="../doc/scripthome.html">Scripts</a>
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH Ploticus_variables PL "02-JUN-2006   PL ploticus.sourceforge.net"

.SH Variables
More advanced ploticus scripts can set and reference \fBvariables\fR.
Variable names must begin with a letter and may contain letters, digits, underscore (_) and period (.).
Names are case-sensitive.  Maximum length of a variable name is 38 characters.
Variables may hold numbers, alphanumerics, or
.ig >>
<a href="commalist.html">
.>>
\0lists,
.ig >>
</a>
.>>
but are always internally stored in alphanumeric form, with a maximum content length is 250 characters.
All variables are global in scope.
.LP
Variables may be assigned using the \fC#set\fR directive, like this:
.nf
\0	#set ymax = 200
.LP
Variables may be referenced (used) anywhere in a script.
An at-sign (\fC@\fR) is used at the beginning of a variable name when its contents
are to be displayed or referenced, for example:
.nf
\0	yrange: 0 @ymax
.fi
.LP
In some situations (\fCselect\fR statements and getdata \fCfilter\fRs) you may need to use 
two at-signs (@@), so that one at-sign survives the script evaluation (if that's what you want).
.LP
An attempt to evaluate a variable that has never been assigned a value
will result in cancellation of the evaluation (the variable name will be
passed through transparently) and no error condition will be raised.
Several 
.ig >>
<a href="variables.html#reserved">
.>>
\0reserved variables
.ig >>
</a>
.>>
exist.  

.ig >>
<a name=system></a>
.>>
.ig >>
<br><br><br>
.>>

.SH System Variables
Ploticus sets certain variables, described below.
These variables may be accessed by user scripts as needed.
.LP
In order to reference a variable immediately after the proc that set the variable, 
.ig >>
<a href="scriptsyntax.html">
.>>
\0#endproc
.ig >>
</a>
.>>
must be used to mark the end of the proc that set the variable.
.LP
Nothing bad will happen if you happen to assign a value to one of these
variables, other than the chance that ploticus will update the variable's value
when you're not expecting it.

.ig >>
<br><br><br>
.>>

.LP
\fBPLVERSION\fR
.IP \0
The ploticus version number.

.ig >>
<br><br>
.>>

.LP
\fBAREALEFT  AREARIGHT  AREABOTTOM  AREATOP\fR
.IP \0
Set by \fBproc areadef\fR to the locations of the current plot area edges in
.ig >>
<a href="attributetypes.html#positionunits">
.>>
absolute units.  
.ig >>
</a>
.>>
 .

.ig >>
<br><br>
.>>

.LP
\fBXMIN  XMAX  YMIN  YMAX\fR
.IP \0
Set by \fBproc areadef\fR to the limits in scaled units, of the plotting area.

.ig >>
<br><br>
.>>


.LP
\fBXINC YINC\fR
.IP \0
Set by \fBproc axis\fR to the scale increment in X or Y.

.ig >>
<br><br>
.>>


.LP
\fBDATAXMIN\fR, \fBDATAXMAX\fR
.IP \0
The minima and maxima of the data field when xautorange is used.
Different from XMIN and XMAX in that these do not include any margin.

.ig >>
<br><br>
.>>

.LP
\fBDATAYMIN\fR, \fBDATAYMAX\fR
.IP \0
The minima and maxima of the data field when yautorange is used.
Different from YMIN and YMAX in that these do not include any margin.


.ig >>
<br><br>
.>>


.LP
\fBCM_UNITS\fR
.IP \0
if user has opted to use centimeters as absolute units, this will contain 1,
otherwise 0.


.ig >>
<br><br>
.>>


.LP
\fBDEVICE\fR
.IP \0
the output display format, one of: 
.br
\fCpng gif eps ps bwps x11 jpeg svg svgz swf\fR

.ig >>
<br><br>
.>>


.LP
\fBNFIELDS\fR
.IP \0
the number of fields per record in the current data set.

.ig >>
<br><br>
.>>


.LP
\fBNRECORDS\fR
.IP \0
the number of records in the current data set.


.ig >>
<br><br>
.>>

.LP
\fBNVALUES\fR
.IP \0
the number of in-range plottable points rendered by the most recent
\fBproc scatterplot\fR or \fBproc rangebar\fR.  
May be used in the proc scatterplot legend label.


.ig >>
<br><br>
.>>

.LP
\fBRANGEBARMEDIAN RANGEBARMIN RANGEBARMAX\fR
.IP \0
the median, min, and max value of the most recently drawn rangebar,
in scaled units.


.ig >>
<br><br>
.>>

.LP
\fBTOTALS\fR
.IP \0
Set by \fBproc processdata\fR when action is \fCtotals\fR, it holds
either a single total value, or a comma-delimited list of total values.


.ig >>
<br><br>
.>>

.LP
\fBBREAKFIELD1 ..\fR
.IP \0
Set by \fBproc processdata\fR when action is \fCbreaks\fR, it holds
the contents of the break field(s), before reaching the breakpoint.


.ig >>
<br><br>
.>>

.LP
\fBXSTART\fR, \fBYSTART\fR
.IP \0
X and Y location where the most recent \fBproc lineplot\fR curve began, in scaled units.


.ig >>
<br><br>
.>>

.LP
\fBXFINAL\fR, \fBYFINAL\fR
.IP \0
X and Y location where the most recent \fBproc lineplot\fR curve ended, in scaled units.


.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif"> 
</center>
</td></tr>
</table>
<br>
<center>
Ploticus is hosted at http://ploticus.sourceforge.net <br>
<img src="http://sourceforge.net/sflogo.php?group_id=38453" width="88" height="31" border="0" alt="SourceForge Logo">
</center>
.>>
