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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Thu, 07 Jun 2007 23:42:16 -0000


albertel		Thu Jun  7 19:42:16 2007 EDT

  Modified files:              
    /loncom/xml	lonplot.pm 
  Log:
  - BUG#5288
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.117 loncom/xml/lonplot.pm:1.118
--- loncom/xml/lonplot.pm:1.117	Wed May 23 18:36:28 2007
+++ loncom/xml/lonplot.pm	Thu Jun  7 19:42:14 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.117 2007/05/23 22:36:28 albertel Exp $
+# $Id: lonplot.pm,v 1.118 2007/06/07 23:42:14 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -274,10 +274,10 @@
          },
      gridtype     => {
 	 default     => 'Cartesian',
-	 test        => sub {$_[0]=~/^(Polar|Cartesian)$/},
+	 test        => sub {$_[0]=~/^(Polar|Cartesian|Linear-Log|Log-Linear|Log-Log)$/},
 	 description => 'Grid type:',
 	 edit_type   => 'choice',
-         choices     => ['Cartesian','Polar']
+         choices     => ['Cartesian','Polar','Linear-Log','Log-Linear','Log-Log']
          },
      lmargin      => {
 	 default     => 'default',
@@ -1123,6 +1123,13 @@
     # cartesian or polar grid?
     if (lc($Apache::lonplot::plot{'gridtype'}) eq 'polar') {
         $gnuplot_input .= 'set grid polar'.$/;
+    } elsif (lc($Apache::lonplot::plot{'gridtype'}) eq 'linear-log') {
+        $gnuplot_input .= 'set logscale x'.$/;
+    } elsif (lc($Apache::lonplot::plot{'gridtype'}) eq 'log-linear') {
+        $gnuplot_input .= 'set logscale y'.$/;
+    } elsif (lc($Apache::lonplot::plot{'gridtype'}) eq 'log-log') {
+        $gnuplot_input .= 'set logscale x'.$/;
+        $gnuplot_input .= 'set logscale y'.$/;
     } else {
         # Assume Cartesian
     }