How to display decimal points on a graph ?
조회 수: 88 (최근 30일)
이전 댓글 표시
Hello, everyone I have a question below part.
How to display decimal points on a graph ?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1015780/image.png)
댓글 수: 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!