Filter löschen
Filter löschen

setting up 2nd y axis scale

2 Ansichten (letzte 30 Tage)
Milan Sumegi
Milan Sumegi am 6 Mär. 2019
Bearbeitet: Adam Danz am 28 Mär. 2019
Hi all I have a problem to set up my right side Y axes scaler. Is run for me 0->3000 how I wanted but I would like if its make by 300 and not 500 each steps.
here is my script:
x2=linspace(15,25);
y2=linspace(2500,2500);
X=Book1{:,1};
Y=Book1{:,2};
x5=linspace(2.5,2.5);
y5=linspace(0,0.298);
x=Book2{:,1};
y=Book2{:,2};
yyaxis right
plot(x,y,'m',x5,y5,'m')
ylim([0 1])
title 'Calculated Power Curve for Dec. 2011'
xlabel 'Wind Speed [m/s]'
ylabel 'Pover Co-efficient [-]'
hold on
yyaxis left
plot(x2,y2,'g',X,Y,'g')
xlim([0 25])
ylim([0 3000])
ylabel 'Power [kW]'
If I run the script above is looks like this.
untitled.jpg
Thank you every answers

Antworten (1)

Adam Danz
Adam Danz am 6 Mär. 2019
Bearbeitet: Adam Danz am 25 Mär. 2019
Judging from the image, you mean you'd like to fix the left axis.
yyaxis left
set(gca, 'YTick', [0:300:3000])
  2 Kommentare
Milan Sumegi
Milan Sumegi am 13 Mär. 2019
yes I only want fx the left axis, thanks
Adam Danz
Adam Danz am 13 Mär. 2019
Bearbeitet: Adam Danz am 28 Mär. 2019
Those two lines of code should do the trick! ;)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by