Hello,
is there any way to force Matlab to use 35000 instead of 3.5 x 10^4 on y axis usig plot command?
My plot command creates figure that has x10^N on y axis just like shown in the attached picture.

 Akzeptierte Antwort

Voss
Voss am 6 Mai 2022
Bearbeitet: Voss am 7 Mai 2022
yyaxis left
plot(0:1000:50000)
yyaxis right
plot(400000000:-10000000:0)
set(get(gca(),'YAxis'),'Exponent',0,'TickLabelFormat','%.0f')

4 Kommentare

And what if plot is used inside app (UI.Axes)? The first argument in plot function would be: app.UIAxes, but gca() is not possible in that case. How I should specify Exponent in such case?
yyaxis left
plot(app.UIAxes, 0:1000:50000)
yyaxis right
plot(app.UIAxes, 400000000:-10000000:0)
Replace gca() with the handle to the uiaxes, which is app.UIAxes:
set(get(app.UIAxes,'YAxis'),'Exponent',0,'TickLabelFormat','%.0f')
Askic V
Askic V am 8 Mai 2022
Thank you very much!. It's very helpful.
Voss
Voss am 9 Mai 2022
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Exploration finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Mai 2022

Kommentiert:

am 9 Mai 2022

Community Treasure Hunt

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

Start Hunting!

Translated by