How to display decimal points on a graph ?

111 ビュー (過去 30 日間)
Steven KIM
Steven KIM 2022 年 5 月 30 日
コメント済み: Steven KIM 2022 年 5 月 30 日
Hello, everyone I have a question below part.
How to display decimal points on a graph ?

採用された回答

Alberto Cuadra Lara
Alberto Cuadra Lara 2022 年 5 月 30 日
編集済み: Alberto Cuadra Lara 2022 年 5 月 30 日
Hello Steven,
To display decimals point you can use xtickformat and ytickformat for the x and y axis, respectively. Also, you may want to remove the exponent from the axis.
f = figure;
ax = gca;
x = linspace(0, 1e3);
y = linspace(-3, 3) * 1e-3;
plot(x,y);
% Set format to decimals
ytickformat('%.3f');
% Remove exponent
ax.YAxis.Exponent = 0;
  1 件のコメント
Steven KIM
Steven KIM 2022 年 5 月 30 日
Thank you so much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by