version 1.96, 2004/05/26 19:44:20
|
version 1.97, 2004/06/21 20:04:29
|
Line 36 use Apache::response;
|
Line 36 use Apache::response;
|
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::edit; |
use Apache::edit; |
|
|
|
use vars qw/$weboutputformat $versionstring/; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::lonplot',('gnuplot')); |
&Apache::lonxml::register('Apache::lonplot',('gnuplot')); |
|
# |
|
# Determine the version of GNUPLOT |
|
$weboutputformat = 'gif'; |
|
$versionstring = `gnuplot --version`; |
|
if ($versionstring =~ /^gnuplot 4/) { |
|
$weboutputformat = 'png'; |
|
} |
} |
} |
|
|
## |
## |
Line 460 sub end_gnuplot {
|
Line 469 sub end_gnuplot {
|
## return image tag for the plot |
## return image tag for the plot |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result .= <<"ENDIMAGE"; |
$result .= <<"ENDIMAGE"; |
<img src = "/cgi-bin/plot.gif?file=$filename.data&output=gif" |
<img src = "/cgi-bin/plot.gif?file=$filename.data&output=$weboutputformat" |
width = "$plot{'width'}" |
width = "$plot{'width'}" |
height = "$plot{'height'}" |
height = "$plot{'height'}" |
align = "$plot{'align'}" |
align = "$plot{'align'}" |