[Scilab-users] Plot Graphs on Different Axes

CRETE Denis denis.crete at thalesgroup.com
Tue Jul 27 17:58:08 CEST 2021


Hello,
I think this should work:

scf();
plot2d(x1',y1')
a=newaxes();
plot2d(x2',y2')
a.x_location="top";
a.y_location="right";
a.filled="off";

HTH
Denis

De : users <users-bounces at lists.scilab.org> De la part de Samuel Enibe
Envoyé : mardi 27 juillet 2021 17:17
À : Users mailing list for Scilab <users at lists.scilab.org>
Objet : [Scilab-users] Plot Graphs on Different Axes

I have the following sets of data:
x1 = [0 10 20 30 40 50 60 70 80 90];
y1 = [12.27   12.09   11.53    10.63    9.4     7.89    6.14    4.2    2.13   0];
x2 = [2   1.5     1    0.5     0    -0.5    -1    -1.5    -2];
y2 = [4.42   6.01   7.85   9.94   12.27   14.85   17.67   20.74   24.05];

I want to plot y1 with x1  (Graph 1) on Bottom x-axis and left y-axis and y2 with x2 (Graph 2) on Top x-axis and Right y-axis. The axes have different ranges of values as seen from the example data

What is the simplest way of doing this?

Samuel  Enibe
University of Nigeria, Nsukka, Nigeria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210727/44edbb3f/attachment.htm>


More information about the users mailing list