--- loncom/xml/lonplot.pm 2012/07/24 11:02:58 1.164 +++ loncom/xml/lonplot.pm 2012/12/05 01:04:03 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.164 2012/07/24 11:02:58 foxr Exp $ +# $Id: lonplot.pm,v 1.169 2012/12/05 01:04:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -132,7 +132,12 @@ my $real_test = sub {$_[0]=~s/\s+//g;$_[0]=~/^[+-]?\d*\.?\d*([eE][+-]\d+)?$/}; my $pos_real_test = sub {$_[0]=~s/\s+//g;$_[0]=~/^[+]?\d*\.?\d*([eE][+-]\d+)?$/}; -my $color_test = sub {$_[0]=~s/\s+//g;$_[0]=~/^x[\da-fA-F]{6}$/}; +my $color_test; +if ($version < 4.6) { + $color_test = sub {$_[0]=~s/\s+//g;$_[0]=~s/^\#/x/;$_[0]=~/^x[\da-fA-F]{6}$/}; +} else { + $color_test = sub {$_[0]=~s/\s+//g;$_[0]=~s/^x/#/;$_[0]=~/^\#[\da-fA-F]{6}$/}; +} my $onoff_test = sub {$_[0]=~/^(on|off)$/}; my $key_pos_test = sub {$_[0]=~/^(top|bottom|right|left|outside|below| )+$/}; my $sml_test = sub {$_[0]=~/^(\d+|small|medium|large)$/}; @@ -1883,8 +1888,8 @@ sub write_gnuplot_file { $gnuplot_input .= "set samples $Apache::lonplot::plot{'samples'}\n"; # title, xlabel, ylabel # titles - my $extra_space_x = ($xtics{'location'} eq 'axis') ? ' 0, -0.5 ' : ''; - my $extra_space_y = ($ytics{'location'} eq 'axis') ? ' -0.5, 0 ' : ''; + my $extra_space_x = ($xtics{'location'} eq 'axis') ? ' offset 0, -0.5 ' : ''; + my $extra_space_y = ($ytics{'location'} eq 'axis') ? ' offset -0.5, 0 ' : ''; if ($target eq 'tex') { $gnuplot_input .= "set title \"$title\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($title)) ; @@ -2091,7 +2096,7 @@ sub write_gnuplot_file { } # Write the output to a file. - &Apache::lonnet::logthis($gnuplot_input); # uncomment to log the gnuplot input. + # &Apache::lonnet::logthis($gnuplot_input); # uncomment to log the gnuplot input. open (my $fh, "> $tmpdir$filename.data"); binmode($fh, ':utf8'); print $fh $gnuplot_input;