How to display decimal points on a graph ?
117 次查看(过去 30 天)
显示 更早的评论
Hello, everyone I have a question below part.
How to display decimal points on a graph ?
0 个评论
采纳的回答
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;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!