octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First datapoint is discarded on second call to plot


From: Daniel J Sebald
Subject: Re: First datapoint is discarded on second call to plot
Date: Wed, 07 Mar 2007 11:42:40 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Bug fix attached...


Søren Hauberg wrote:
Hi,
Running a recent checkout from cvs I got a weird behaviour when I plot to curves. This code

  figure
  hold on
    f = sin(0:0.1:2*pi);
    plot(f)
    plot(1+f)
  hold off

produces to sine curves but the second one (the upper one) is missing the first data point.

Søren



--

Dan Sebald
phone: 608 256 7718
email: daniel DOT sebald AT ieee DOT org
URL: http://webpages DOT charter DOT net/dsebald/
--- /usr/local/share/octave/2.9.9+/m/plot/__uiobject_draw_axes__.m      
2007-03-04 16:14:47.000000000 -0600
+++ ./__uiobject_draw_axes__.m  2007-03-07 11:37:15.060501272 -0600
@@ -670,6 +670,8 @@
                 filespec{i}, usingclause{i}, titlespec{i}, withclause{i});
       endfor
       fputs (plot_stream, ";\n");
+      fflush (plot_stream);
+
       for i = 1:data_idx
        if (strcmp (filespec{i}, "-"))
          if (nd == 2)
@@ -688,15 +690,12 @@
              endfor
            endif
          endif
-         fputs (plot_stream, "e");
+         fputs (plot_stream, "e\n");
          fflush (plot_stream);
        endif
       endfor
     endif
 
-    fputs (plot_stream, "\n");
-    fflush (plot_stream);
-
   else
     print_usage ();
   endif    

reply via email to

[Prev in Thread] Current Thread [Next in Thread]