필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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)

채택된 답변

Star Strider
Star Strider 2020년 6월 22일
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:
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by