[LON-CAPA-cvs] cvs: loncom /xml lonplot.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 24 Apr 2002 21:24:40 -0000


matthew		Wed Apr 24 17:24:40 2002 EDT

  Modified files:              
    /loncom/xml	lonplot.pm 
  Log:
  Change to allow more characters in title, labels, and curve names.
  Other minor formatting changes.
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.66 loncom/xml/lonplot.pm:1.67
--- loncom/xml/lonplot.pm:1.66	Wed Apr 24 12:38:40 2002
+++ loncom/xml/lonplot.pm	Wed Apr 24 17:24:40 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.66 2002/04/24 16:38:40 matthew Exp $
+# $Id: lonplot.pm,v 1.67 2002/04/24 21:24:40 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,7 @@
 my $key_pos_test   = sub {$_[0]=~/^(top|bottom|right|left|outside|below| )+$/};
 my $sml_test       = sub {$_[0]=~/^(small|medium|large)$/};
 my $linestyle_test = sub {exists($linestyles{$_[0]})};
-my $words_test     = sub {$_[0]=~s/\s+/ /g;$_[0]=~/^([\w\(\)]+ ?)+$/};
+my $words_test     = sub {$_[0]=~s/\s+/ /g;$_[0]=~/^([\w~!\@\#\$\%^&\*\(\)-=_\+\[\]\{\}:\;\'<>,\.\/\?\\]+ ?)+$/};
 
 ###################################################################
 ##                                                               ##
@@ -999,7 +999,8 @@
     # border
     $gnuplot_input .= ($plot{'border'} eq 'on'?
 		       'set border'.$/           :
-		       'set noborder'.$/         );    # title, xlabel, ylabel
+		       'set noborder'.$/         );
+    # title, xlabel, ylabel
     # titles
     $gnuplot_input .= "set title  \"$title\"\n"  if (defined($title)) ;
     $gnuplot_input .= "set xlabel \"$xlabel\"\n" if (defined($xlabel));
@@ -1028,7 +1029,7 @@
     if (%key) {
 	$gnuplot_input .= 'set key '.$key{'pos'}.' ';
 	if ($key{'title'} ne '') {
-	    $gnuplot_input .= 'title " '.$key{'title'}.'" ';
+	    $gnuplot_input .= 'title "'.$key{'title'}.'" ';
 	} 
 	$gnuplot_input .= ($key{'box'} eq 'on' ? 'box ' : 'nobox ').$/;
     } else {