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

raeburn raeburn at source.lon-capa.org
Wed Jul 9 11:17:32 EDT 2014


raeburn		Wed Jul  9 15:17:32 2014 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/xml	lonplot.pm 
  Log:
  - For 2.10
    - gnuplot 4.4 reports an error unless "offset" is included before the x,y offset
      amount when used in "set xlabel" and"set ylabel".
      (see lonplot.pm rev. 1.169).
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.152 loncom/xml/lonplot.pm:1.152.6.1
--- loncom/xml/lonplot.pm:1.152	Sat Nov 14 19:13:36 2009
+++ loncom/xml/lonplot.pm	Wed Jul  9 15:17:32 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.152 2009/11/14 19:13:36 faziophi Exp $
+# $Id: lonplot.pm,v 1.152.6.1 2014/07/09 15:17:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1681,8 +1681,12 @@
     $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 $offset;
+    if ($version >= 4.4) {
+        $offset = 'offset ';
+    }
+    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)) ;




More information about the LON-CAPA-cvs mailing list