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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 13 Jun 2002 17:58:47 -0000


matthew		Thu Jun 13 13:58:47 2002 EDT

  Modified files:              
    /loncom/xml	lonplot.pm 
  Log:
  Bug 519.  Adds interface to gnuplot 'set samples' command for setting the
  number of samples to use when gnuplot is given a function like 'sin(x)' to
  plot instead of raw data.
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.76 loncom/xml/lonplot.pm:1.77
--- loncom/xml/lonplot.pm:1.76	Wed May  1 11:58:42 2002
+++ loncom/xml/lonplot.pm	Thu Jun 13 13:58:47 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.76 2002/05/01 15:58:42 matthew Exp $
+# $Id: lonplot.pm,v 1.77 2002/06/13 17:58:47 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -112,7 +112,7 @@
 ##                                                               ##
 ###################################################################
 my @gnuplot_edit_order = 
-    qw/alttag bgcolor fgcolor height width font transparent grid border align/;
+    qw/alttag bgcolor fgcolor height width font transparent grid samples border align/;
 
 my $gnuplot_help_text = <<"ENDPLOTHELP";
 <p>
@@ -208,6 +208,13 @@
 	 edit_type   => 'choice',
 	 choices     => ['small','medium','large']
 	 },
+     samples         => {
+	 default     => '100',
+	 test        => $int_test,
+	 description => 'Number of samples for non-data plots',
+	 edit_type   => 'choice',
+	 choices     => ['100','200','500','1000','2000','5000']
+	 },
      align        => {
 	 default     => 'center',
 	 test        => sub {$_[0]=~/^(left|right|center)$/},
@@ -1000,6 +1007,8 @@
     $gnuplot_input .= ($plot{'border'} eq 'on'?
 		       'set border'.$/           :
 		       'set noborder'.$/         );
+    # sampling rate for non-data curves
+    $gnuplot_input .= "set samples $plot{'samples'}\n";
     # title, xlabel, ylabel
     # titles
     $gnuplot_input .= "set title  \"$title\"\n"  if (defined($title)) ;