|
From: Ethan M. <merritt@u.washington.edu> - 2005-02-23 01:29:59
|
On Tuesday 22 February 2005 05:11 pm, Jingzhao Ou wrote:
>
> I installed Gnuplot 4.0 on a RedHat Linux box. It seems to be working fine from
> the bash command line.
OK
> I ran a gnuplot script test.dem on PHP as the following:
>
> system("gnuplot test.dem");
>
> However, I failed to get any output from Gnuplot even though running "gnuplot
> test.dem" directly in the bash command line would give me the desired result. I
> tried also CGI written in Perl. I can run the Perl script on the bash command
> line and generate the desired ps file. However, when I run it through CGI, I
> got nothing!
It would help if you showed us the gnuplot script itself.
Does your http daemon have write access to the directory where
you are trying to create a postscript file?
Are there error messages in the http daemon's error log file?
Does the 'test.dem' script refer to any data files, and if so are they
in the daemon's default directory?
And a separate comment:
Postscript is probably the wrong output format for displaying on a web page.
Have you considered creating a PNG image instead, or emitting in-line
SVG code as part of a dynamic http document?
> Can any one kindly give me a hand! Thanks a lot for your help!!!
Here is a fragment from a working perl-script in daily use on my web site:
open(GNUPLOT,">$tempfile.gnu");
if ($y_fixed eq "on") { print GNUPLOT " set yrange [0:$y_range]\n" ; }
print GNUPLOT <<EOFgnu;
set data style linespoints
set style line 1 lt -1 lw 3 pt 7
set style line 2 lt 3 lw 3 pt 9
set style line 3 lt 1 lw 3 pt 5
set style line 4 lt 4 lw 3 pt 6
set title 'Distribution of anisotropy by atom class'
set xlabel 'Anisotropy'
set ylabel 'Fraction of atoms' -1
set label '$PLOT_LABEL' at graph 0.025, graph 0.95 left
set format y '%4.2f'
set size 1.00, 1.00
set term png $png_options
set output '$tempfile.png'
plot $proteinplot
$naplot
$solventplot
$hetatmplot
EOFgnu
close(GNUPLOT);
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|