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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 13 Sep 2004 13:34:06 -0000


matthew		Mon Sep 13 09:34:06 2004 EDT

  Modified files:              
    /loncom/xml	lonplot.pm 
  Log:
  Towards bug 3316: Tell gnuplot to output a png or gif as appropriate.
  Omit font specification on labels for $target eq 'web'.
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.102 loncom/xml/lonplot.pm:1.103
--- loncom/xml/lonplot.pm:1.102	Thu Sep  9 15:48:21 2004
+++ loncom/xml/lonplot.pm	Mon Sep 13 09:34:06 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.102 2004/09/09 19:48:21 albertel Exp $
+# $Id: lonplot.pm,v 1.103 2004/09/13 13:34:06 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1030,7 +1030,7 @@
     }
     # set term
     if ($target eq 'web') {
-	$gnuplot_input .= 'set term gif ';
+	$gnuplot_input .= 'set term '.$weboutputformat .' ';
 	$gnuplot_input .= 'transparent ' if ($plot{'transparent'} eq 'on');
 	$gnuplot_input .= $plot{'font'} . ' ';
 	$gnuplot_input .= 'size '.$plot{'width'}.','.$plot{'height'}.' ';
@@ -1123,7 +1123,11 @@
     my $label;
     foreach $label (@labels) {
 	$gnuplot_input .= 'set label "'.$label->{'text'}.'" at '.
-	    $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'}.' font "Helvetica,'.$pt.'pt"'.$/ ;
+	    $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'};
+        if ($target eq 'tex') {
+            $gnuplot_input .=' font "Helvetica,'.$pt.'pt"' ;
+        }
+        $gnuplot_input .= $/;
     }
     if ($target eq 'tex') {
         $gnuplot_input .="set size 1,".$plot{'height'}/$plot{'width'}*1.38;