--- loncom/xml/lonplot.pm	2012/07/24 10:50:54	1.163
+++ loncom/xml/lonplot.pm	2012/10/07 15:04:44	1.167
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.163 2012/07/24 10:50:54 foxr Exp $
+# $Id: lonplot.pm,v 1.167 2012/10/07 15:04:44 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)$/};
@@ -463,7 +468,13 @@ my %tic_defaults =
 	 description => 'Number of minor tics per major tic mark',
 	 edit_type   => 'entry',
 	 size        => '10'
-	 },         
+	 }, 
+     rotate => {
+	 default => 'off',
+	 test    => $onoff_test,
+	 description => 'Rotate tic label by 90 degrees if on',
+	 edit_type   => 'onoff'
+     }
      );
 
 my @axis_edit_order = ('color','xmin','xmax','ymin','ymax','xformat', 'yformat', 'xzero', 'yzero');
@@ -1714,6 +1725,9 @@ sub generate_tics {
 	
 	$result .= "set $type $spec->{'location'}  ";
 	$result .= ($spec->{'mirror'} eq 'on') ? 'mirror ' : 'nomirror ';
+	if ($spec->{'rotate'} eq 'on') {
+	    $result .= ' rotate ';
+	}
 	if (defined $spec->{'ticspecs'}) {
 	    $result .= '( ';
 	    my @ticspecs;
@@ -1750,6 +1764,7 @@ sub generate_tics {
 sub write_gnuplot_file {
     my ($tmpdir,$filename,$target)= @_;
     my ($fontsize, $font_properties) =  &get_font($target);
+    &Apache::lonnet::logthis("Fontsize: $fontsize");
     my $gnuplot_input = '';
     my $curve;
     #
@@ -2081,6 +2096,7 @@ sub write_gnuplot_file {
 	$linestyle_index++;	# Each curve get a unique linestyle.
     }
     # Write the output to a file.
+
     # &Apache::lonnet::logthis($gnuplot_input); # uncomment to log the gnuplot input.
     open (my $fh, "> $tmpdir$filename.data");
     binmode($fh, ':utf8');