Adding data points to plot

classic Classic list List threaded Threaded
2 messages Options
Andrea Sosso Andrea Sosso
Reply | Threaded
Open this post in threaded view
|

Adding data points to plot

I wasn't able to find a way to add new data point to an already
generated plot.
Direct modification of the matrix in the polyline child "data"  seem to  
have the cancellation of the plot as only effect.

Collette yann-2 Collette yann-2
Reply | Threaded
Open this post in threaded view
|

Re: Adding data points to plot

Andrea Sosso a écrit :
> I wasn't able to find a way to add new data point to an already
> generated plot.
> Direct modification of the matrix in the polyline child "data"  seem
> to  have the cancellation of the plot as only effect.
An example:

X = 1:100;
plot(X,X);
h = gce();
h.children.data = [h.children.data; 101 50];
a = gca();
a.data_bounds = [1 1; 101 100];

YC


--
-----------------------------
Yann COLLETTE
Software Development Engineer
-----------------------------
The Scilab Consortium
Digiteo Foundation
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay France
Phone: +33.1.39.63.57.82