#set TITLE = "Frequently Asked Questions"
#include top
 

.SH FAQ
Frequently asked questions about ploticus.  If you don't see it here,
just ask (\fCsteve@sgpr.net\fR).

.LP
\fBWhere can I get \fBploticus\fR?
.IP
\fBwww.sgpr.net\fR or the central Europe mirror site.

.LP
\fBWhere can I report problems or get help?\fR
.IP
.ig >>
<a href="../doc/Problems.html">
.>>
How to submit a problem report
.ig >>
</a>
.>>

.LP
\fBWhat computing environments are supported?\fR
.IP
Definitely: Solaris 2, Linux, AIX, FreeBSD, Irix, HP-UX, HP3000 MP/ix, Digital Unix 4.0,
Windows/NT with Cygwin, Windows/NT with DJGPP.
Probably: Other modern Unix-like platforms.


.LP
\fBHow many users are there?\fR
.IP
Most users who have written in are present on the
.ig >>
<a href="../doc/Feedback.html">
.>>
current 
.ig >>
</a>
.>>
or
.ig >>
&nbsp; <a href="../doc/Feedback00.html">
.>>
earlier
.ig >>
</a>
.>>
user feedback pages.


.LP
\fBWhat is the easiest way to get started?\fR
.IP
#set FILE = "../doc/Download.html"
#set TAG = Download
#include link
the software.  Then,
see of one of the 
#set FILE = "prefabs.html"
#set TAG = "available prefabs"
#include link
is close to what you want.
When a prefab is used, all that needs to be specified
by the user are several key parameters.  
.IP
For more flexibility and power, you can develop your own
#set FILE = "scripts.html"
#set TAG = "ploticus scripts"
#include link


.LP
\fBCan you add a search engine to the web site?  It is difficult to sift through
all the examples and handbook sections.\fR 
.IP
For now, I would recommend
downloading the entire doc node including gallery examples
and handbook.  Then you can search and peruse all of the material locally
using "grep" or however you prefer to do it.


.LP
\fBCan I use ploticus as part of a commercial package or service?\fR
.IP
As of version 1.41 ploticus is covered under the GNU General Public License.
The GPL does not allow ploticus code to be used in proprietary software
that is to be distributed to others
(please see the
.ig >>
<a href="../doc/Copyright.html">
.>>
copyright page
.ig >>
</a>
.>>
for details, or contact me at \fCsteve@sgpr.net\fR if questions).
.IP
For cases where standalone ploticus executables are included
as a reporting utility within a larger specialized system,
I am comfortable in considering ploticus as an ancillary part of such a
package, and interpret the GPL section 2 as requiring that GPL be attached
only to ploticus, and not the whole package.  For this to be allowed,
the rest of your product must be considered an independent and
seperate work in its own right, the executables must be derived from 
unmodified standard ploticus source code (except as needed to get it to compile 
and work properly), and you must include a prominent statement to the effect that 
graphs are produced using the Ploticus data display program (c) 2001 Steve Grubb 
and that the Ploticus program is freely downloadable at www.sgpr.net.  



.LP
\fBI have compiled ploticus on platform XYZ.  Should I send you the binaries?\fR.
.IP
For a while I was receiving binaries for various platforms and posting them to the web
site.  However because of the work involved and the tendency for this to slip out of date,
I would now prefer to just add a URL link to the binary on your site.


.LP
\fBPloticus wants to put its temp files on /usr/tmp, but my system does not
have /usr/tmp.\fR
.IP
As of version 1.38, you can specify a temp directory in the ploticus config file.
You can, of course, also directly modify the default temp directory in preliminaries.c.

.LP
\fBI need a customized plot.   If I am coding a script from scratch, what is the 
bare minimum of code I need?\fR
.IP
If starting from scratch, just remember that in order to
do a plot you need data (#proc getdata) a plotting area
(#proc areadef) with the X and Y ranges defined, and a
plotting proc such as #proc bars.  The plotting proc usually
requires that a data field be given.  Other parameters will
use defaults.


.LP
\fBWhy would I want to use ploticus rather than a MainStream
desktop spreadsheet / charting package / slides package 
to create graphs?\fR
.IP
Ploticus might be your choice for stylistic reasons or just
because it suits the problem or application.
.IP
You can also use Ploticus \fBwith\fR other document/media production tools (e.g.
generate data displays using \fBploticus\fR then import PNG into PowerPoint,
Word, etc.)

.LP
\fBHow does ploticus compare with other freeware plotting/charting packages?\fR
.IP
Here is a list of some
.ig >>
<a href="../doc/Faq.other.html">
.>>
other plotting packages 
.ig >>
</a>
.>>
(thanks to Arthur Ferruzzi).
.IP
In general, ploticus is good at making graphs like you would see in
newspapers and news magazines, business publications,
journals for medical and social sciences, and so on.
.IP
Ploticus is not a function or mathematical plotting package like gnuplot, nor would it
be a good choice for applications where mathematical formulas or scientific 
notations are to be rendered as an integral part of the data display.
.IP
Ploticus is also not intended as a "marketing" graphics package.
Its goal is to display data crisply without extra decoration
and distracting "dingbats" that cloud the picture.
Thus there is little support for 3-D effects, 
gradient backgrounds, and so on.  


.LP
\fBAre there any licensing restraints related to GIF generation
with ploticus ?\fR
.IP
Because of the confusion surrounding the licensing mess, 
PNG is recommended rather than GIF (
.ig >>
<a href="../doc/web.html">more info</a>
.>>
), and GIF support may be dropped at some future point in time.
.IP
However, please note the following:
Ploticus does not read GIF files.
Ploticus writes run-length-encoded (RLE) GIF files.
Our understanding is that these RLE GIF files do not
use patented LZW compression (
.ig >>
<a href="../doc/gifpatent.html">more info</a>
.>>
).  


.LP
\fBWhat does ploticus include?\fR
.IP
Two programs, \fBpl\fR and \fBpltab\fR.
If you download the binaries, there is no 'install' 
procedure.  If you download the sources, the build is uncomplicated
and should work fine.  Then, just move the executables
(pl, pltab, plpng, and pltabpng)
to an accessible bin and you're all set.

.LP
\fBWhat does the pl program do?\fR
.IP
\fBpl\fR generates plots and graphs, as specified in a 
.ig >>
<a href="scripts.html">
.>>
script
.ig >>
</a>
.>>
 .  
Most of the gallery examples were generated using \fBpl\fR.
It generates data displays using a page layout model, which
means that you need to specify exactly
where on the "page" each plot will be placed.
To use it, you would type a command such as this:
.br
\fBpl -gif lineplot1.htm\fR

.LP
\fBWhat does the pltab program do?\fR
.IP
Pltab is an occasionally useful utility that takes ordinary ascii tables
and lists such as program output and creates presentable tables 
by setting them in a nice font, and often adding embellishments
such as rulings, shading, font changes, and embedded plots and graphs.
Pltab is a productive way to get plain program output (tables and lists)
into presentable form; no formatting codes or massaging of output
is required.
Pltab automatically overflows onto multiple pages and thus is useful
in creating multi-page graphical case displays such as
.ig >>
<a href="../tabgallery/caselist.html">
.>>
this
.ig >>
</a>
.>>
 .  To use \fBpltab\fR you would type a command such as this:
.br
\fBpltab table.out | lp\fR

.LP
\fBThe name 'pl' conflicts with that of my prolog interpreter.  
Also the file name extension .pl is easy to confuse with 'perl'.\fR
.IP
Please feel free to rename the executables as appropriate for your system.
Ploticus is "aware" of the following file name extensions that may be used for ploticus scripts: .pl .p .pls .htm .html.  
"Aware" means that if no output file name is specified (-o) 
ploticus can strip off the extension and tack on .png, .gif, .eps, etc. to make
the output file name.  Otherwise out.png (etc.) will be used as a fallback.

.LP
\fBCan I invoke ploticus from C/C++/Perl/etc?\fR
.IP
Currently the best way is to invoke pl or pltab using
\fCsystem()\fR or something similar.

.LP
\fBHow can I use ploticus from a CGI?\fR
.IP
As of version 2.00 you can invoke pl directly as a CGI program.
#set FILE = "cgi.html"
#set TAG = "Here's how to do it."
#include link
Another way to go about it is to 1) generate a unique temp file name; 2) invoke ploticus via shell or system()
and build a PNG or GIF file using the unique name; 3) reference that file in an <IMG> tag;
4) clean up temp PNG / GIF files regularly using a find command run by cron.


.LP
\fBWhen I use ploticus from the command line it works fine, but when invoked from my perl
script it misbehaves..\fR
.IP
Sorry, I don't use perl, and can't be of any help on perl implementation issues.

.LP
\fBI have a program that generates a stream of
X Y coordinates to create a special display.  How can I
display my results via Ploticus?\fR
.IP
\fBProc Drawcommands\fR may be used, assuming you can adjust
or post-process your program's output to conform to the Drawcommands 
command set.

.LP
\fBDo I have to learn the script language?\fR
.IP
You do not, if you can get by with just the
#set FILE = "prefabs.html"
#set TAG = "prefabs"
#include link
\0.  For more customization and flexibility you can write scripts
and then you do need to become familiar with the script language.
Fortunately, it is a goal-driven specifications language
rather than a purely procedural one.  As with many 
tools of this type, the best way to operate may be to
copy an existing script and modify it to suit.
The web-based handbook may be navigated quickly to find 
the names and uses of the various attributes.
And, as mentioned above, if you use Ploticus much you might
benefit from downloading the entire docs/examples node
for easier searching and perusal.


.LP
\fBWhat graphics file formats can be created?\fR
.IP
You can create PNG or GIF images (typically used in web pages
and other software applications),
paginated PostScript files that can be printed,
and EPS files (for printing or import into other document).
You can also use it interactively on an X11 display.
As of version 2.00 you can optionally link against your own copy of
the GD library to get JPEG and WBMP.


.LP
\fBWhat plot data formats are accepted?\fR
.IP
Ordinary ascii files, where fields are either
white space delimited, tab delimited or comma delimited.  
(The latter is sometimes called spreadsheet format, or .csv.)  
See
.ig >>
<a href="dataformat.html">
.>>
data formats
.ig >>
</a>
.>>
 .
.IP
Most plotting operations are done on data fields.
For example, you might do a bargraph on the values in field 3 of the data set.
If your data are not organized that way, you can get data into a usable form using
\fBproc transform\fR after the data are read.


.LP
\fBWhy isn't it interactive?\fR
.IP
The main thrust has been to develop an engine
that can produce graphics non-interactively, so that
it can be run in an automated, unattended way.


.LP
\fBAre any statistical capabilities included?\fR
.IP
There is a built-in facility (proc tabulate) for computing frequency
distributions.  Means, medians, quartiles, standard deviations, etc. may
be computed using proc rangebar.  Proc curvefit can compute linear
regression curve and Pearson correlation coefficient \fIr\fR.


.LP
\fBHow can I render a proper less-than-or-equal-to symbol, Portugese
characters, or other special symbols?\fR
.IP
This is now described
#set FILE = "fonts.html"
#set TAG = here
#include link


.LP
\fBI would like dates to use the German month abbreviations rather
than the English.\fR
.IP
Non-english month abbreviations, etc. may be specified in a
.ig >>
<a href="../doc/config.html">
.>>
ploticus config file
.ig >>
</a>
.>>
For example, see
.ig >>
<a href="../gallery/plconfig.spanish">
.>>
plconfig.spanish
.ig >>
</a>
.>>
or 
.ig >>
<a href="../gallery/plconfig.russian">
.>>
plconfig.russian
.ig >>
</a>
.>>


.LP
\fBIs there any way to get thousands separators so that large numbers are 
more readable e.g. 3,024,582? 
Also, I would prefer European style display of numbers, e.g. comma used as
the decimal point, and period (.) used as the thousands separator.\fR
.IP
You can add a \fCnumbernotation\fR entry into your ploticus config file to
do either of these things (as of version 1.34).

.LP
\fBIs ploticus Y2K compliant?\fR
.IP
As of 9/00 there have been
no problems reported.  
Of course, as always, correctness of individual results is 
the user's responsibility.

.LP
\fBWhat about large data sets?\fR
.IP
The capacities are fairly large (see
.ig >>
<a href="limits.html">
.>>
program limits
.ig >>
</a>
.>>
).  If your data set is too large, you may be able to use the \fCselect\fR or
\fCfilter\fR attributes of \fBproc getdata\fR to pair down the size.
\fCselect\fR will select only certain records; \fCfilter\fR may be used to
keep only certain fields.


.LP
\fBCan I import the graphs into PowerPoint?\fR
.IP
Yes.  
PNG and GIF files may be inserted as pictures with PowerPoint.
EPS files may be used with PowerPoint if the result will be
rendered on a PostScript film imager.


.LP
\fBHow can I view PNG or GIF files that I generate?\fR
.IP
You can view them with a locally-running web browser if you
use a URL beginning with \fCfile:///\fR, for example, 
\fCfile:///export/home/steve/plot.gif\fR (note that there are
three slashes, two for the URL syntax and one representing the
root of the file system).  You can also
use an image viewing utility such as the publicly available 
\fBxv\fR package to view images locally.
You can have ploticus invoke xv automatically to display
your results using \fC-viewer xv\fR on the command line.
.IP
Note that old versions of browsers and image viewing
tools may not support PNG.
.ig >>
<a href=" http://www.libpng.org/pub/png/pngapvw.html">Here's a list of PNG viewers</a>
.>>


.LP
\fBHow can I preview PostScript files that I generate?\fR
.IP
Use a PostScript previewing tool such as the publicly
available \fBghostview\fR package.
You can have ploticus invoke gv automatically to display
your results using \fC-viewer gv\fR on the command line.


.LP
\fBHow can I enlarge or reduce my results?\fR
.IP
Use the \fB-scale\fR command line option.

.LP
\fBHow can I make thumbnails?\fR
.IP
Just use a small scale factor, such as \fB-scale 0.3\fR.
Very small text is rendered as lines automatically.

.LP
\fBHow can I crop my results?\fR
.IP
Use one of the \fB-crop\fR, \fB-croprel\fR or \fB-tightcrop\fR command line options.

.LP
\fB-tightcrop is close to what I want but it is cropping too closely on one side.\fR
.IP
Try \fB-croprel\fR.

.LP
\fBI am trying to make a fairly large GIF file (12" wide by
4" high).  The rightmost portions of the result are cut off.
Is this a bug?\fR
.IP
It is not really a bug but not quite ideal in the
way that it is handled..  The default output size is 8" x 8". 
If doing X11, PNG or GIF and your desired output 
exceeds either of these dimensions
you should specify -pagesize on the command line, or pagesize in proc page,
and give a big enough area to fit the entire result.


.LP
\fBWhy is garbage being displayed at the end of my title?\fR
.IP
Attributes that are multi-line need to be terminated with a blank
line.  Perhaps the blank line was left out.

.LP
\fBI have changed an attribute value but nothing happens.\fR
.IP
If the attribute in question follows a multi-line attribute,
you may have forgotten to terminate the multi-line attribute
with a blank line.

.LP
\fBIs there any way for a single-line attribute such as
proc getdata's 'fieldnames' to be expressed in multiple lines?\fR
.IP
Not currently.  Only "multiline text" attributes may occupy multiple lines,
and they must be terminated by a blank line.
All other attributes must be contained within a single line of text.

.LP
\fBSomething in my script does not seem to be working.  
See a fragment below....\fR
.IP
.nf
.ft C
\0#proc getdata
\0file: myfile.dat
\0
\0#if @NRECORDS = 0
\0  #exit
\0#endif
\0
\0#proc bars..
\0  ..etc..
.fi
.LP
\fB....... I know that my datafile indeed has many records of data in it, however,
the script always exits without plotting any bars.\fR
.IP
The problem here is a nuance/glitch and has to do with the way that ploticus scripts
are parsed.
Variables, such as NRECORDS in your case, that are set within a proc do not become available
to the script until the proc is finished.  Procs are delineated
by \fB#proc\fR statements.  Thus, what happened is that ploticus didn't
realize that you were finished with your proc getdata when the #if came along,
and at that time NRECORDS was still zero.
.IP
To solve this, insert a \fC#proc endproc\fR statement immediately before the #if statement.
It should be used in any situation where an #if or #set statement will use variables set by 
the previous proc.
#proc endproc is really just a do-nothing marker and does not need to be used routinely 
all the time.  I still trip up on this one occasionally -SG

.LP
\fBWhat are #clone and #saveas and how do they work?\fR
.IP
\fB#clone\fR and \fB#saveas\fR are used
when doing several similar plots, such as a set of four
bar graphs that have the same style.  \fB#saveas\fR saves
the attribute settings for one proc invocation.  \fB#clone\fR
uses a set of attribute settings that was saved earlier.
An example is
.ig >>
<a href="../gallery/volunteers.htm">
.>>
volunteers
.ig >>
</a>
.>>
See also the
.ig >>
<a href="../doc/scripts.html">
.>>
script syntax description
.ig >>
</a>
.>>
 .

.LP
\fBI have a graph where I set up the plotting area with procs 
areadef, yaxis, and two separate invocations of proc xaxis.  I
want to replicate this plotting area several times.  How do
I clone the plotting area?\fR
.IP
You need to use #saveas within every proc that is involved (with
different instance names), and then use #clone all of the procs.
There is no way to clone a set of procs together in one operation.

.LP
\fBCan I have 2 separate scatter plots
on the same plot area?  With 2 separate data sets, i.e. not
col1 = x, col2 = y, col3 = other-y, but "these coord pairs
are one kind of scatter dot, and this other completely
unrelated set are a different kind of scatter dot."\fR
.IP 
Yes, you do this by:
.nf 
\0	#proc areadef
\0 	...
\0 
\0	#proc getdata
\0	file: data1
\0 
\0	#proc scatterplot
\0 	...
\0 
\0	#proc getdata
\0	file: data2
\0 
\0	#proc scatterplot
\0	.. etc..
.fi 
The first areadef stays in effect until a new areadef is specified,
thus any number of plots may be rendered in the area.

.LP
\fBCan I make a Y axis on the right edge of the plot rather than the left?\fR
.IP
Yes, see gallery example 
.ig >>
<a href="../gallery/sa12.htm">sa12</a>
.>>
 .

.LP
\fBIs it possible to overlay two coordinate systems on one plot?\fR
.IP
Yes, see gallery example 
.ig >>
<a href="../gallery/sa13.htm">sa13</a>
.>>
which overlays Celsius and Fahrenheit.

.LP
\fBHow can I have grid lines in orange every 0.1 unit, and then grid lines
in black every 1.0 unit?\fR
.IP
Invoke #proc axis twice and overlay the two, to get more complex 
systems of grids, tics, and stubs.  See example
.ig >>
<a href="../gallery/sa14.htm">sa14</a>
.>>
which does this.

.LP
\fBAn axis labelling question: my xrange goes from 0.5 to 12.  When I 
do stubs of "increment 1" they are drawn at 0.5, 1.5, 2.5, etc..  I want them to be
at 1.0, 2.0, etc.\fR
.IP
Stub placement begins by default at the minima.  To override this, the stubrange
attribute can be used.  For your case, it would be: \fCstubrange: 1.0\fR

.LP
\fBIs there a way to do a broken Y axis?\fR
.IP
Yes, although broken axes cannot be done in an automated way.
See gallery example
.ig >>
<a href="../gallery/brokenaxis.htm">
.>>
brokenaxis
.ig >>
</a>
.>>
and the man page for
.ig >>
<a href="../doc/breakaxis.html">
.>>
proc breakaxis
.ig >>
</a>
.>>

.LP
\fBI am trying to do a plot where the X axis is dates expressed in quarter years
(quarters), to show quarterly results.  It is not coming out right.\fR
.IP
It is a little bit tricky because data in quarter notation is converted
to a full date midpoint, so the X range needs to be expressed in a full date notation,
then you change units to quarter notation.  See the example
.ig >>
<a href="../gallery/quarters.htm">quarters</a>
.>>
which illustrates.


.LP
\fBIs there any way to make an axis progress from a large value to a small value?\fR
.IP
Yes, although it is not entirely straighforward.
See gallery example
.ig >>
<a href="../gallery/hbars4.htm">
.>>
hbars4
.ig >>
</a>
.>>

Ploticus is limited by its implementation in that it can only produce axes that run from a low value
to a higher value.  In order to "fool" it into going from high to low,
you must reverse the sign of your data values (proc getdata's filter attribute
might be used to do this), and define your plotting range accordingly.
Then you can use proc axis's reversesign option (introduced in version 1.3) 
to present the axis stubs.


.LP
\fBHow can I make the Y axis of my plotting area automatically scaled to my data?\fR
.IP
Use proc areadef's \fCyautorange\fR attribute.
This takes several sub-attributes, the most important of which is \fCdatafield=\fIn\fR.

.LP
\fBI am trying to set up an automated system that will generate a reasonable plot for 
any reasonable numeric data that gets thrown at it.  Areadef's xautorange and yautorange
get me part of the way there, but it appears I still need to specify the stub increment
and "autorange nearest" attributes manually, which has me stymied.\fR
.IP
As of version 1.39, you can get a reasonable default stub increment for numeric data by stating:
\fCstubs: inc\fR or \fCstubs: inc 0\fR.
Also as of version 1.39, you can get a reasonable default "autorange nearest"
for numeric data by simply omitting the word "nearest" (the default used to
be to go to the exact minima and maxima; to do this you now need to state
"nearest=exact").


.LP 
\fBI want to plot my data in log-log
scale with an x-range from 0.1 to 100 and a yrange from 1 to 1000.
The trouble is that ploticus uses fixed tic increments by default.
This makes the tics pile together at the upper limits.  Is there an easy
way to produce tics with variable values, for example, the increment for
the range from 1 to 10 is 1, from 10 to 100 is 10, etc.?\fR
.IP 
You could use proc axis' \fCselflocatingstubs\fR attribute, which allows 
you to place the tics and/or stubs whereever you wish.  However it is 
not automatic.  An example is
.ig >>
<a href="../gallery/loglog.htm">
.>>
loglog
.ig >>
</a>
.>>

.LP
\fBI have large files containing dates and times of events.
I would like to plot them as histograms across time.
Some events happen concurrently (at the same time).
Thus I need to run a frequency distribution on the date and time,
however, proc tabulate has an upper limit of 200 unique instances.
Is there a way to do this?\fR
.IP
Yes, use \fBproc transform\fR with the \fBcount\fR action (introduced
in version 1.3).
Your data will have to be sorted (or at least grouped) so that
all like datetimes are together.  A gallery example where this 
is done is
.ig >>
<a href="../gallery/hitcount.htm">
.>>
hitcount
.ig >>
</a>
.>>

.LP
\fBI've been using ploticus off and on for about 2 months now.
Typically plotting statistical data from our ADSM backup
accounting log.  We are using this to trend growth and plan
expansion.  Recently some client or clients are out of
control and using too much space.  I would like to
graphically display the data...  Here's a slice of it....\fR
.IP
.nf 
01/01/2000,BINC_MSN,6.321745
01/01/2000,LEUSDB01,15.896682
01/01/2000,MINERVA,15.880768
01/02/2000,HIGHSMITH1,22.693413
01/04/2000,MINERVA,16.165971
.fi 
.LP
\fB...... As you can probably tell, date,client,datum.
.br
I would like a stacked bar graph (x-axis = date) a different
color for each client and the height of the bar determined
by the 3rd field.  I can't figure out the color piece (there
are a total of 13 unique clients, not all appear each day).
Any help would be appreciated.\fR
.IP 
You can use proc tabulate with \fCaccumfield\fR (a new attribute in version 1.34)
to tally up each user's number for each day, to produce a matrix
of numbers.  Then, these values are plotted.  It requires proc bars
to be invoked once for each user, so it is only practical if the
set of users is known in advance.


.ig >>
<a name=filter></a>
.>>
.LP
\fBI have a data set with mm/dd/yyyy dates in field 2 and hh:mm times
in field 3.  How can I plot these using the datetime scaling type?\fR
.IP
Ploticus datetime values have the form \fIdate\fB.\fItime\fR.
The date and the time may in any of the supported notations.
The dot (.) separator is required.
You can use proc getdata's \fCfilter\fR attribute to concatentate fields
2 and 3 like this:
.nf
\0	#proc getdata
\0	file: mydata
\0	filter: @@@@1 @@@@2.@@@@3 @@@@4 @@@@5
\0
\0	showresults: yes
.fi


.LP
\fBI am doing a stacked bar graph, stacking the values found in fields 4, 5, and 6.
Is there any way to use \fCyautorange\fB for this task?\fR
.IP
You can use proc getdata's \fCfilter\fR attribute to sum up fields 4 + 5 + 6
and create a new data field holding the result.  Then give yautorange the
new field.  Here is a sample:
.nf
\0	#proc getdata
\0	file: mydata
\0	filter: ##declare SUM
\0		##set SUM = $arithl(@@@@4+@@@@5+@@@@6)
\0		@@@@1 @@@@2 @@@@3 @@@@SUM 
\0
\0	showresults: yes
\0
\0	#proc areadef
\0	yautorange: datafield=4
\0	...etc..
\0
.LP 
\fBIn the results from sar -u, I can get "idle" time in %. Subtracting that
from 100 would give me the total CPU load data.  Is there an easy way to 
accomplish that within the ploticus script?\fR
.IP 
Yes, similarly to the above example, you can use proc getdata's filter attribute.
Suppose your idle time is in field #4:
.nf 
\0	#proc getdata
\0	file: myfile
\0	filter: ##declare CPUTOT
\0       	##set CPUTOT = $arith(100-@@@@4)
\0        	@@@@1 @@@@2 @@@@3 @@@@CPUTOT @@@@5 @@@@6
\0 
\0	showresults: yes
.fi

.LP
\fBI am doing a clustered bar graph, using the values found in fields 1 and 3.
Is there any way to use \fCyautorange\fB for this task?  It only uses
one data field in finding the scale.\fR
.IP
\fBThis is probably the most asked question lately.
As of version 1.41 you can specify multiple datafields in 
.ig >>
<a href="autorange.html">
.>>
autorange
.ig >>
</a>
.>>
, and they will all be scanned for minima and maxima.
.IP
The old solution still works too:
.nf
\0	#proc getdata
\0	file: mydata
\0	showresults: yes
\0	filter: ##declare MAX
\0		##set MAX = $max(@@@@1,@@@@3)
\0		@@@@2 @@@@MAX
\0
\0	#proc areadef
\0	yautorange: datafield=2
\0	...etc..
\0
.fi

.LP
\fBHow can I make \fCautorange\fB work for stacked bars, or error bars?
.IP
Use autorange's \fCcombomode\fR subattribute.


.LP
\fBI am producing bar graphs in postscript.  
There are seven different types of bars, using seven shades of gray.
It is hard to distinguish between
some of the grays, especially after photocopying.\fR
.IP
Beginning in Version 1.3, hatch patterns were introduced as a color option,
which may be useful in getting more distinguishable bar shades.

.LP
\fBWhen I print on an Apple Laserwriter the grays look different than
on an HP (w/ postscript cartridge).\fR
.IP
The halftoning process used to render grays on PostScript printers has
some hardware dependencies, hence the differences in appearance.

.LP
\fBCan I use hatch patterns in pie graphs?\fR
.IP
No, they may only be used to fill rectangular areas such as bars.

.LP
\fBWhy isn't vertical text displayed properly on X11?\fR
.IP
Ploticus doesn't store its own fonts or have its own 
font system; rather it uses fonts that are native to the various graphics platforms
or drivers.  X11 does not support vertical fonts (at least it didn't seem to
when I wrote the X11 code several years ago).  PostScript and PNG/GIF do support 
vertical fonts.

.LP
\fBIf I had one feature request for ploticus it would be
support for setting text at angles other than 0 and 90.\fR
.IP 
This could be done for postscript rendering easily enough
but would be difficult in X11 and PNG/GIF, since the underlying
libraries do not support angled fonts.


.LP
\fBI am specifying some data using #proc trailer.
Can I have a data statement in any proc def and pull coords out of it with
#in<anyprocname>
.IP 
No.  You can only have one #proc trailer per script file,
and the only way to read in that data is 
.nf
\0   #proc getdata
\0     #intrailer
.fi
The only #proc that reads (or specifies) data for plotting is #proc
getdata.
.IP 
proc trailer was intended as a way to embed data but keep it
at the end of the script, for convenience.  #proc getdata's #intrailer
operator just tells it to look at the end of the file.  #intrailer starts
with a pound sign (#) because action needs to be taken by the script
interpreter (i.e. internal reasons).
.IP 
If you need to embed multiple data sets, you could do it by using:
.nf
\0   #proc getdata
\0   data:  1 2
\0          3 4
\0          5 6
\0           ..etc..
\0 
\0  #proc scatterplot
\0 
\0  #proc getdata
\0   data:  
\0          9 8
\0          7 6
\0          5 4
\0          .. etc..
\0 
\0   #proc scatterplot
\0 
\0   ..etc.
.fi
 
.LP
\fBI would like to know if there is a way to incorporate an HP-UX system date
command (`date +%b%d` is the command} into a ploticus script.  I would
like the UNIX command to be used in the tile of #proc page, but as long as I
can have the date on the graph page I would be happy.\fR
.IP
One way would be to use the $system() function.  Here is an example:
.IP
.nf
.ft C
\0 #declare TODAY
\0 #set TODAY = $system(date'+%b%d)
\0 #proc page
\0 title:  Some set of plots
\0        Run on: @TODAY
\0
\0  ..etc.
.fi
.ft R
$system is described near the end of the (long) functions(pl) man page
(ploticus/doc/functions.html).  Any spaces in the unix command need to
be represented as single quotes (').


.LP
\fBHow can I access a data field from within a ploticus script?  I tried
@3 and @@@@3 but no luck.\fR
.IP
Constructs such as @@@@3 only have meaning within 
operations that are processing a stream of data, such as a select attribute
or getdata filter script.
They have no meaning in the rest of a ploticus script.
As of version 1.39 a new function called $dataitem(row,field) is
available to retrieve specific data cells.  
For example, to assign variable M to the contents of the current data
set, first row, first column, do this:
.br
\fC#set M = $dataitem(1,1)\fR



.LP
\fBI am generating rangebars and would like to save and use the calculated statistics data set
for other purposes.  However, the format that proc rangebar produces is not
usable.\fR
.IP
As of version 1.39, you can get a terser stats output (showbriefstats) and customize the row
identifiers to some degree (briefstatstag).  It is also easy to place the result into a
file (showstatsfile).

.LP
\fBWhen generating rangebars with outliers it seems that a symbol is mandatory.
I don't want any symbol, just a label.\fR
.IP
As of version 1.39 it is possible to say "none" for nearoutliersym and faroutliersym.

.LP
\fBI am using your package to create stock graphs, from stock data, just as you 
have shown in the example. It takes maybe 2 seconds to produce the graph, where on 
Yahoo's site, whatever they are doing, it is instantaneous (I am using a cable modem). 
Is there any way I can increase the performance of your package?\fR
.IP
The Yahoo finance site probably uses a package that is optimized for
the types of graphs they produce; they may also cache 
the more frequently requested graphs, and you can bet they are using
high-end systems that are optimized for fast web page generation and delivery.
.IP
Ploticus, on the other hand, is flexible and allows many, many options to be specified, 
including the color and style of most text and line objects.  
All of these options
have to be interpreted at run time and this adds overhead.
A bigger performance issue though, is that
Ploticus' development philosophy 
has been to code the various features in a robust, simple, maintainable way, 
and not necessarily the most efficient way.  
For instance,
many features are implemented using temporary scratch files rather than memory.
Most internal lookups (variables, commands, categories, date types) are 
implemented as plain linear searches.
Data are represented internally in character form, meaning that there is a lot of
character to floating point conversion going on.
.IP
Bottlenecks often become more evident as data sets get larger
or plotting procedures become more elaborate.
Features that are suspected of being particular bottlenecks are shown below.
.RS
.IP \(bu
\fBproc getdata\fR \fCfilter\fRs
.IP \(bu
\fBproc tabulate\fR, especially with larger numbers of unique values
.RE


.LP
\fBI have one data set with about 80 different cases represented in it.  Each case has
several dozen rows of data.  I want to produce a rangebar on each case.
However, looking at the examples that do similar to this, it seems
as if ploticus has to process the cases one at a time and for each case
scan the entire data set, selecting out the current case.  This means that
I will be scanning this data set 80 times which is horribly inefficient.  
Is there a better way?\fR
.IP
Yes, there is now (version 1.39) a new action in proc processdata called \fBbreaks\fR.
It works within a loop, and causes the data set to be scanned only once.
It requires that the data be sorted by case.
An example that uses this is
.ig >>
<a href="../gallery/mouse.htm">mouse</a>
.>>


.LP
\fIMore to come....\fR

#include bottom
