left y axis values are not visible

9 views (last 30 days)
Dor Shoham
Dor Shoham on 15 Aug 2022
Edited: Cris LaPierre on 15 Aug 2022
Hi,
i use Matlab 2022a .
i plot dual y chart and the left y axis values are not visible .
below is capture of the plot and the code that i use for plotting in matlab app designer
yyaxis(app.UIAxes,'left')
plot(app.UIAxes,app.days,app.CumCases);
hold (app.UIAxes,'on');
yyaxis(app.UIAxes,'right')
plot(app.UIAxes,app.days,app.CumDeaths);
hold (app.UIAxes,'off');
appriciate your support
  2 Comments
Cris LaPierre
Cris LaPierre on 15 Aug 2022
I can't reproduce. Is there more code you can share? Perhaps the entire app? Consider sharing your data by saving it to a mat file and attaching it to your post using the paperclip icon.
As an aside, you do not need to use hold here.
dpb
dpb on 15 Aug 2022
Edited: dpb on 15 Aug 2022
What happens if you just plot() one set of data first, without the yyaxis stuff? Does axes show normal size/labels, then?
Have you done anything to the UIAxes 'Position' or other properties other than default elsewhere/first? Something like that would be my first guess...or somehow managed to turn the 'Visible' property to 'Off'
What does
app.UIAxes.YAxis.Visible
show at command line if set a breakpoint after the first call to plot?

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre on 15 Aug 2022
Edited: Cris LaPierre on 15 Aug 2022
The issue is happening because you have set your X and Y tick modes and tick label modes to Manual. Set them back to Auto, and you will see ticklabels automatically appear on your left Y-Axis.
Otherwise, be sure to manually set Y ticks and X tick labels. Without them, the Y axis will remain blank.

Community Treasure Hunt

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

Start Hunting!