Is it possible to plot 2 y axis in the appdesigner? It is similar to plotyy in the regular figure. They you can assign the plotting axis yyaxis left/right;

 채택된 답변

Mirek Janda
Mirek Janda 2018년 4월 5일
편집: Mirek Janda 2018년 4월 11일

10 개 추천

Easy solution
yyaxis(app.UIAxes,'left')
plot(app.UIAxes,xdata,ydata);
yyaxis(app.UIAxes,'right')
plot(app.UIAxes,xdata,y2data);

댓글 수: 4

Roman
Roman 2018년 4월 11일
How about setting yyaxis limits properly on left and right side in app designer? Thanks
You can create callback on the UIAxis. When it runs it executes the commands...
% Code that executes after component creation
function startupFcn(app)
yyaxis(app.UIAxes,'right')
app.UIAxes.YLabel.String='NAME for your RIGHT Y Axis';
app.UIAxes.YLim = [0 25];
app.UIAxes.YColor = [1 0 0]; % font colour
yyaxis(app.UIAxes,'left')
app.UIAxes.YLabel.String='NAME for your LEFT Y Axis';
app.UIAxes.YLim = [0 100];
app.UIAxes.Color = [1 1 0.8]; % plot box colour
app.UIAxes.XGrid = 'on';
app.UIAxes.YGrid = 'on';
Andrew Davies
Andrew Davies 2019년 10월 17일
this hangs in R2019b on exit or sometimes when the UI elements are changed. Worked finein 2019a.
Jiri Junek
Jiri Junek 2022년 10월 13일
Works on 2022b.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Iurii Medvedev
Iurii Medvedev 2019년 1월 9일

0 개 추천

Help me please.
How to use different grids for different axes?

카테고리

도움말 센터File Exchange에서 Two y-axis에 대해 자세히 알아보기

제품

질문:

2018년 4월 5일

댓글:

2022년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by