[scilab-Users] Plotting data with single x axis and two y axes
giri
giri at leos.gov.in
Tue Feb 16 01:58:51 CET 2010
-----Original
Message-----
From: Samuel Gougeon <Samuel.Gougeon at univ-lemans.fr>
To: users at lists.scilab.org
Date: Sat, 13 Feb 2010 04:32:32 +0100
Subject: Re: [scilab-Users] Plotting data with single x axis and two y
axes
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
Hello friends:
While the solution given by Mr Gougeon works excellently on Scilab 5 at
work I have use an old solaris 8 computer running Scilab 4.0 (RC). This
version of scilab does not recognize the "filled" attribute for
newaxes(). The second plot simply over writes the first
one. Is there any way of making the second one
"transparent" after the plot is completed?
Thanking you.
Sincerely,
Giridhar
----------------------------------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100216/8bb01632/attachment.htm>
More information about the users
mailing list