[scilab-Users] Plotting data with single x axis and two y axes
Samuel Gougeon
Samuel.Gougeon at univ-lemans.fr
Sat Feb 13 04:32:32 CET 2010
Hello Giri,
Here is a commented example showing a way to do what you expect.
There are certainly other ones, noticeably by using drawaxis()
instead of | in addition to newaxes();
Hope That Help
Regards
Samuel
--------
x=linspace(1,7,100);
y1=sin(x);
y2=cos(x)*67;
clf
plot2d(x,y1);
xtitle("Sample with 2 different Y-scales","X","sinus(x)")
legend("sin(x)",-5,%f); // -5 => above the left top corner, no frame
a=newaxes(); // Creates a new default system of axes on the same
area of the window, and makes it the current one
a.filled="off"; // the background of the graphical area should be
transparent, to leave the previous plot apparent
red=color("red");
plot2d(x,y2,axesflag=3,style=red); // plots new data. axesflag=3
means X at the bottom, and Y at the right
// Because the default
legend("67.cos(x)",[6,100],%f); // above the right top corner, no frame
a.font_color=red; // sets color for ticks labels
a.axes_visible=["off","on","off"]; // cancels x axis (else red)
a.y_label.font_foreground=red; // sets color for y-label
a.y_label.text="67.Cosinus(x)"; // set y label
---------------
Giri <giri at leos.gov.in> a écrit :
Hello friends:
I often have to plot data with common x axis values and two
independenty axes values. I would like the y axes to appear on the
left and right hand sides of the plots. I would be grateful to anyone
who can point out how I can do this using plot2d (or any other way).
My data file has three columns (x,y1,y2).
Thanks for your help.
Sincerely,
--Giridhar
-- M. S. Giridhar Thinfilms and Microsensors Group Laboratory for
Electro Optic Systems Indian Space Research Organisation 1st Cross,
1st Stage, Peenya Industrial Estate, Bangalore 560058. Phone:2839
2294, 2839 2291 ext 2212
----------------------------------------------------------------
This mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
solely for the use of the addressee(s). If you are not the intended
recipient, please notify the sender by e-mail and delete the original
message. LEOS has taken every reasonable precaution to remove any
viruses however you should also carry out your own virus checks before
opening the e-mail or attachment.
More information about the users
mailing list