--- loncom/xml/lonplot.pm 2004/05/26 19:44:20 1.96 +++ loncom/xml/lonplot.pm 2004/06/21 20:04:29 1.97 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.96 2004/05/26 19:44:20 matthew Exp $ +# $Id: lonplot.pm,v 1.97 2004/06/21 20:04:29 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,8 +36,17 @@ use Apache::response; use Apache::lonxml; use Apache::edit; +use vars qw/$weboutputformat $versionstring/; + 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'; + } } ## @@ -460,7 +469,7 @@ sub end_gnuplot { ## return image tag for the plot if ($target eq 'web') { $result .= <<"ENDIMAGE"; -