How to display decimal points on a graph ?

100 Ansichten (letzte 30 Tage)
Steven KIM
Steven KIM am 30 Mai 2022
Kommentiert: Steven KIM am 30 Mai 2022
Hello, everyone I have a question below part.
How to display decimal points on a graph ?

Akzeptierte Antwort

Alberto Cuadra Lara
Alberto Cuadra Lara am 30 Mai 2022
Bearbeitet: Alberto Cuadra Lara am 30 Mai 2022
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;

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by