[Scilab-users] Plotting curves against a set of points
Jan Åge Langeland
j-lan at online.no
Tue Dec 22 18:55:36 CET 2015
Have you tried plot() and replot()? You can do quite a bit with that by
using LineSpec and GlobalProperty. The example below includes plotting
with primary and secondary Y axis:
Jan
clf;
t=1:100;
x=t.^2/100;
y=[4,12,32,72,95];
z=[500,1100,2100,4100,5000];
replot([t(1),ceil(t($)); 0, 120]);
a=gca();
b = newaxes();
b.y_location = "right";
b.filled = "off";
b.axes_visible = ["off","on","on"];
b.axes_bounds = a.axes_bounds;
replot([t(1),ceil(t($));0 , 6000]);
sca(a);
plot(t,x,'g',t(1:5)*20,y,'*r');
sca(b);
plot(t(1:5)*20,z,"*m") ;
On 22.12.2015 11:37, Alasdair McAndrew wrote:
> Hello,
>
> I'm experimenting with fitting an ODE model (a non-linear system) to
> some data; what I want to do is to plot the curves representing the
> ODE numerical solutions against the initial (discrete) data points.
> And I want to be able to specify the thickness and color of the
> curves, as well as providing a legend to it.
>
> I can do the curves by carefully using gca, gce etc, and copying and
> pasting examples from the documentation, but I don't yet know how to
> plot the data points.
>
> For example, I have a time vector containing about 150 points, and an
> array containing all the corresponding ODE values; thus:
>
> plot2d(t,x',style=[color("red"),color("green"),color("blue")]);
>
> However, I don't know how to include in this plot the 14 or 15 data
> points.
>
> I find gca, gce somewhat tricky to use - is there an easier way: a
> front end to plotting multiple curves and specifying the
> characteristics of each curve?
>
> Many thanks,
> Alasdair
>
> --
> http://www.facebook.com/alasdair.mcandrew
> <http://www.facebook.com/alasdair.mcandrew>
> https://plus.google.com/+AlasdairMcAndrew/posts
> <https://plus.google.com/+AlasdairMcAndrew/posts>
> https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108
> <https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108>
> https://twitter.com/amca01 <https://twitter.com/amca01>
> http://numbersandshapes.net <http://numbersandshapes.net>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20151222/2a32af83/attachment.htm>
More information about the users
mailing list