.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
-->
</STYLE>
<title>ploticus: on-the-fly graph generation</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>On-the-fly graph generation</h2></td>
  <td align=right>
  <small>
  <a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  <a href="../doc/Welcome.html">Welcome</a> &nbsp; &nbsp;
  <a href="../gallery/index.html">Gallery</a> &nbsp; &nbsp;
  <a href="../doc/Contents.html">Handbook</a> 
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH On-the-fly_graph_generation PL "18-APR-2002   PL ploticus.sourceforge.net"

.LP
On-the-fly graph generation is useful for
dynamic content web sites and automatic report generation.
Ploticus is suitable for these situations since it is a non-interactive command 
line tool with a relatively small code size.
.LP
Prefabs may be used, or your plots can be script-based.  With scripts, variables
are often passed in via the command line.  It is also possible to have your
program build a ploticus script on the fly, but as this can get fairly convoluted
it is recommended only when the necessary flexibility cannot be gotten from 
passing in variables, embedded #if / #else, etc.

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

.SH Invoking pl via the shell
.LP
This is appropriate if you are using a dynamic web content
system such as PHP, or invoking \fBpl\fR via \fBcron\fR or some other
automatic command issuer.
Generally the procedure is:
.IP 
1. generate a unique temp file name for the output 
.IP
2. invoke \fBpl\fR via the shell, using the temp file as the output file (-o)
.IP 
3. display the temp file using an \fC<img>\fR tag
.IP
4. remove the temp file or set up an automatic process to do so.  For example, on
unix systems you can place the following command into a \fCcrontab\fR and run it
every night to automatically remove files that are over one day old:
.br
\fC/usr/bin/find \fItmpdir\fC  ! -type d  -mtime +1 -exec rm -f {} \\;

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

.SH Direct CGI mode
.LP
Another option for producing dynamic web content is to invoke ploticus in
.ig >>
<a href="cgi.html">
.>>
\0direct cgi mode.
.ig >>
</a>
.>>
Within an \fC<img>\fR tag, specify a URL that invokes ploticus
with the desired parameters.  
Advantages over shell mode:
you do not need to be running within a dynamic content system (eg. PHP),
and shell overhead and temp file I/O are avoided.  Disadvantages: since 
pl is directly invoked as a CGI there are security issues that must be fully 
understood by the programmer.

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

.SH From within perl, python, PHP, java, etc.
.LP
I currently know of no interfaces that allow ploticus to be called 
within these environments.  Invocation via the shell is recommended.


.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>
.>>
