Avoid exponential values as y-axis label in App Designer

Dear all,
I would like to avoid the exponential style on the y-axes labels. I currently have the following code which results in the following error message: Unrecognized method, property, or field 'ytickformat' for class 'matlab.ui.control.UIAxes'.
I have tried other things such as the codes that I have commented out.
app.UIAxes_nomcashflow.Visible = 'on';
app.UIAxes_nomcashflow.XLimMode = 'auto';
app.UIAxes_nomcashflow.YLimMode = 'auto';
%app.UIAxes_nomcashflow.Exponent = 0;
%app.UIAxes_nomcashflow.TickLabelFormat='%.0f';
%app.UIAxes_nomcashflow.ticklabelformat('%.0f')
app.UIAxes_nomcashflow.ytickformat('%.2f')
app.UIAxes_nomcashflow.XTick = (1:length(cashflow));%nez
app.UIAxes_nomcashflow.XTickLabel = (0:(length(cashflow)-1)); %neu
zoom(app.UIAxes_nomcashflow,'on');
plot(app.UIAxes_nomcashflow, cashflow,'LineWidth',2.0);
hold(app.UIAxes_nomcashflow, 'on');
plot(app.UIAxes_nomcashflow,cashflow_v,'LineWidth',2.0);
hold(app.UIAxes_nomcashflow, 'off');
legend(app.UIAxes_nomcashflow, 'Project 1', 'Project 2');

 採用された回答

dpb
dpb 2021 年 2 月 1 日
編集済み: dpb 2021 年 2 月 2 日

0 投票

The 'exponent' property is a property of the NumericRuler axis object, not the main axes.
app.UIAxes_nomcashflow.YAxis.Exponent = 0;
should do what you want.

3 件のコメント

Maria Hart
Maria Hart 2021 年 2 月 2 日
Dear dpb,
this option does not work either. I get the error message:
Unrecognized method, property, or field 'Yaxis' for class 'matlab.ui.control.UIAxes'.
Maria Hart
Maria Hart 2021 年 2 月 2 日
With
app.UIAxes_nomcashflow.YAxis.Exponent = 0;
it worked :-)
dpb
dpb 2021 年 2 月 2 日
Yeah, "dot" notation property names are case-sensitive...my typo, sorry.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2021 年 2 月 1 日

コメント済み:

dpb
2021 年 2 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by