Filter löschen
Filter löschen

specifying the axes limits separately for 2 sets of data on the same plot

1 Ansicht (letzte 30 Tage)
I'm using yyaxis left/right to plot different graphs together and I want to change the axes limits for one side. ylim does not work in this case - is there another way to specify the limits for each side separately? I also want to label each side yaxis separately. Does anyone know how to do this?
This is my current code:
yyaxis left
scatter(sqrtinvT7,set7m)
yyaxis right
scatter(sqrtinvT7,set7c)

Akzeptierte Antwort

Star Strider
Star Strider am 22 Jun. 2020
It is necessary to set them individually with respect to each y-axis:
sqrtinvT7 = 1:10; % Create Variable
set7m = rand(size(sqrtinvT7)); % Create Variable
set7c = rand(size(sqrtinvT7)); % Create Variable
yyaxis left
scatter(sqrtinvT7,set7m)
set(gca, 'YLim', [0.2 0.7])
yyaxis right
scatter(sqrtinvT7,set7c)
set(gca, 'YLim', [0.6 0.9])
they are set appropriately here:
.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by