|
From: | Doug Stewart |
Subject: | Re: Can Not Reproduce Plot |
Date: | Fri, 10 Jun 2016 15:43:35 -0400 |
> gnuplot --version
gnuplot 5.1 patchlevel 0
octave:491> ver
----------------------------------------------------------------------
GNU Octave Version: 4.1.0+
GNU Octave License: GNU General Public License
Operating System: Linux 3.13.0-86-generic #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64
...
>From the doc, 28.5 Polynomial Interpolation, shows a plot of points plus two lines. I can not reproduce this. The 'dots' are connected with lines so I get a scribble across the plot of the two lines.
Is this a gnuplot problem?
x = 2 * pi * rand (1, 200);
y = sin (x) + sin (2 * x) + 0.2 * randn (size (x));
## Uniform breaks
breaks = linspace (0, 2 * pi, 41); % 41 breaks, 40 pieces
pp1 = splinefit (x, y, breaks);
## Breaks interpolated from data
pp2 = splinefit (x, y, 10); % 11 breaks, 10 pieces
## Plot
xx = linspace (0, 2 * pi, 400);
y1 = ppval (pp1, xx);
y2 = ppval (pp2, xx);
plot (x, y, ".", xx, [y1; y2])
axis tight
ylim auto
legend ({"data", "41 breaks, 40 pieces", "11 breaks, 10 pieces"})
How do I plot points?
Tom Dean
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |