--- loncom/xml/lonplot.pm 2004/05/26 19:44:20 1.96 +++ loncom/xml/lonplot.pm 2004/06/28 17:02:27 1.99 @@ -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.99 2004/06/28 17:02:27 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 2>/dev/null`; + if ($versionstring =~ /^gnuplot 4/) { + $weboutputformat = 'png'; + } } ## @@ -302,7 +311,7 @@ my %tic_defaults = minorfreq => { default => '0', test => $int_test, - description => 'Number of minor tics between major tic marks', + description => 'Number of minor tics per major tic mark', edit_type => 'entry', size => '10' }, @@ -460,7 +469,7 @@ sub end_gnuplot { ## return image tag for the plot if ($target eq 'web') { $result .= <<"ENDIMAGE"; -