# Re: [Scilab-users] Plotting on left and right y axes

```Thank you very much, Heinz,  for your very helpful and timely response. I am
very grateful.```
```
God bless you.

Samuel Enibe

On Sat, 29 Apr 2023, 20:42 Heinz Nabielek,
<heinznabie...@me.com<mailto:heinznabie...@me.com>> wrote:
Friends:

here is one working example....
Heinz

v=B(:,2);
plot(35,.2,'k+');
histplot(-0.5:30.5,v,style=2);
xgrid();
h1=gca();h1.font_size=4;
xlabel('wind speed (m/s)','fontsize',4);
ylabel('wind speed probability ()','fontsize',4);
title('Power Generation is given by wind speed probability X turbine
performance','fontsize',4);
// Axis y2
h2=newaxes();
c=color("red");
h2.font_color=c;
h2.font_size=4;
plot(35,2,'k+');
function [y]=eff(x)
y=min(((x/10.7).^3),1) .* (x>3) .*(x<=25)
endfunction
xx=0:.1:31;EFF=eff(xx);
plot(xx,EFF,'r-','Linewidth',5);
h2.filled="off";
h2.axes_visible(1)="off";
h2.y_location="right";
h2.children(1).children(1).thickness=2;
ylabel('relative turbine performance','fontsize',4);

Date: Fri, 28 Apr 2023 17:32:02 +0100
From: Samuel Enibe <samuel.en...@unn.edu.ng<mailto:samuel.en...@unn.edu.ng>>
To: Users mailing list for Scilab
<users@lists.scilab.org<mailto:users@lists.scilab.org>>
Subject: [Scilab-users] Plotting on left and right y axes
Message-ID:

<CAJKcLoW1r0dOZTUcOf=dj2vgjp_+nbudajdqjk5dtoe0xyh...@mail.gmail.com<mailto:CAJKcLoW1r0dOZTUcOf=dj2vgjp_+nbudajdqjk5dtoe0xyh...@mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

How can I plot two graphs on the same window,  with graph 1 on the left y
axis,  and graph 2 on the right y axis.

For example,

x = 1:4;
y1 = x.^2;
y2 = x.^3;
plot(x, y1);// y1 on left y axis
plot (x. y2);// y2 on right y axis

Your assistance will be greatly appreciated.

Samuel Enibe

This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential and/or
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

and all attachments,

(iii) Dassault SystÃ¨mes does not accept or assume any liability or
responsibility for any use of or reliance on this email.

Please be informed that your personal data are processed according to our data
privacy policy as described on our website. Should you have any questions
```_______________________________________________