Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > ed05dc5f357c49fdded780f52b150dce > files > 41

ploticus-2.41-2mdv2010.0.i586.rpm

<html>
<head>
<!-- This file has been generated by unroff 1.0, 03/11/09 12:56:14. -->
<!-- Do not edit! -->
<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.41 Mar2009
  <td></tr></table>
</td></tr>
<td>
<br>
<br>

<title>Manual page for Strategies_for_on-the-fly_graph_generation(PL)</title>
</head>
<body>

<p>
On-the-fly graph generation is useful for
dynamic content web sites and automatic report generation.<tt> </tt>
Ploticus is suitable for these situations since it is a non-interactive command 
line tool with a relatively small code size.<tt> </tt>
<p>
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.<tt> </tt>

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


<br><br><br>

<h2>Option 1: direct CGI mode</h2>
<p>
To invoke ploticus in
<a href="cgi.html">
 direct cgi mode,
</a>
you specify a URL that invokes ploticus
with the desired parameters, right within an <tt>&lt;img&gt;</tt> tag, 

<br><br><br>

<h2>Option 2: using quisp_pl</h2>
A new package called
<a href="http://quisp.sourceforge.net">
 quisp_pl
</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.  
<a href="http://quisp.sourceforge.net/download">
 Download the quisp_pl package and try it.<tt> </tt>
</a>
One nice thing you can do with this is create CGI form along with the graph, so users can control
various graph parameters... 
<a href="http://quisp.sourceforge.net/cgi-bin/quisp?rtn=index#graphic">
 here's a live demo example of this.<tt> </tt>
</a>

<br><br><br>

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

<br><br><br>

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

<br><br><br>

<h2>Option 5: invoking pl via the shell</h2>
<p>
The performance penalty for going this route may not be as much as you'd expect.<tt> </tt>
Generally the procedure is:
<dl>
<dt> <dd>
1. generate a unique temp file name for the output 
<dt> <dd>
2. invoke <b>pl</b> via the shell, using the temp file as the output file (-o)
<dt> <dd>
3. display the temp file using an <tt>&lt;img&gt;</tt> tag
<dt> <dd>
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 <tt>crontab</tt> and run it
every night to automatically remove files that are over one day old:
<br>
<tt>/usr/bin/find </tt><i>tmpdir</i><tt>  ! -type d  -mtime +1 -exec rm -f {} \;

<br><br><br>

</tt></dl>
<h2>Option 6: using ploticus CGI via ASP/VBS</h2>
This is discussed here:
<a href="http://groups.yahoo.com/group/ploticus/message/1358">
 ploticus newsgroup message# 1358
</a>

<br><br><br>

<br><br><br>
<h2>Troubleshooting tips</h2>
Here are some troubleshooting tips for running in a webserver-invoked environment:

<ul>
<li>
Be sure your pl command is executable by world

<br><br>
<li>
You generally can't see anything written to stderr on your web browser,
so there could be error messages that you're not seeing.<tt> </tt>

<br><br>
<li>
Verify that pl is in fact being executed or not.  web server
environments typically have a very limited command path.  Try specifying
the full path name of your pl executable.  Try it with these arguments:
<br>
&nbsp; &nbsp;
 <tt> pl -diagfile /tmp/myerrs1 -errfile /tmp/myerrs2</tt>
<br>
and see what appears in those /tmp files ... if those files aren't created
pl is probably not being executed at all.  If they are try adding the
-debug arg and your args, then check the /tmp files again.<tt> </tt>

<br><br>
<li>
Determine the directory where your command is being executed.  Try
making php exec the command  <tt>pwd</tt>  ... you may need to give full pathname
for your data file, etc.<tt> </tt>

<br><br>
<li>
Some web server environments may have restrictions on locations where
files are allowed to be written. pl needs to write to /tmp and needs to
write to create the result png or gif image

<br><br>
<li>
Some web server environments might have restrictions on locations where files can be read from.<tt> </tt>

<br><br>
<li>
In order to use prefabs, the PLOTICUS_PREFABS environment variable must be available 
in the runtime environment.  PLOTICUS_PREFABS=the directory where prefab scripts reside




<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>
<table><tr><td>
Ploticus is hosted at http://ploticus.sourceforge.net</td><td> &nbsp; </td><td>
<a href="http://sourceforge.net/projects/ploticus"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=38453&type=12" 
width="120" height="30" border="0" 
alt="Get ploticus data display engine at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
</td></tr></table>


</center>
</ul>
<p><hr>
Markup created by <em>unroff</em> 1.0,&#160;<tt> </tt>&#160;<tt> </tt>March 11, 2009.
</body>
</html>