.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: strategies for 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>Strategies for 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>
  Version 2.30
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH Strategies_for_on-the-fly_graph_generation PL "25-AUG-2004   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.

.ig >>
<br><br><br>
.>>
There are several strategies for producing on-the-fly web graphs:


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

.SH Option 1: direct CGI mode
.LP
To invoke ploticus in
.ig >>
<a href="cgi.html">
.>>
\0direct cgi mode,
.ig >>
</a>
.>>
you specify a URL that invokes ploticus
with the desired parameters, right within an \fC<img>\fR tag, 

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

.SH Option 2: using quisp_pl
A new package called
.ig >>
<a href="http://quisp.sourceforge.net">
.>>
\0quisp_pl
.ig >>
</a>
.>>
generates web pages dynamically (similarly to php or asp), and ploticus scripts 
or prefab invocations can be embedded within your code to create dynamic graphs.  
.ig >>
<a href="http://quisp.sourceforge.net/download">
.>>
\0Download the quisp_pl package and try it.
.ig >>
</a>
.>>
One nice thing you can do with this is create CGI form along with the graph, so users can control
various graph parameters... 
.ig >>
<a href="http://quisp.sourceforge.net/cgi-bin/quisp?rtn=index#graphic">
.>>
\0here's a live demo example of this.
.ig >>
</a>
.>>

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

.SH Option 3: via perl or python interface
Perl and python interfaces to \fClibploticus\fR have been contributed and are
available under "Accessories" on the
.ig >>
<a href="http://ploticus.sourceforge.net/doc/download.html">
.>>
\0download page.
.ig >>
</a>
.>>

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

.SH Option 4: some other CGI interface to the libploticus API
The 
.ig >>
<a href="api.html">
.>>
\0libploticus API
.ig >>
</a>
.>>
is freely available; developers can write their own
interface to it and invoke as a CGI.

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

.SH Option 5: invoking pl via the shell
.LP
The performance penalty for going this route may not be as much as you'd expect.
Generally the procedure is:
.IP \0
1. generate a unique temp file name for the output 
.IP \0
2. invoke \fBpl\fR via the shell, using the temp file as the output file (-o)
.IP \0
3. display the temp file using an \fC<img>\fR tag
.IP \0
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>
.>>


.ig >>
<br><br><br>
.>>
.SH Troubleshooting tips
In CGI contexts anything written to standard error is unavailable.
Use the \fC-diagfile stdout\fR command line option to see diagnostic messages.
Version 2.11+ offers the \fC-echo stdout\fR command line option which
can be used during debugging to display evaluated script lines.


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