change start point of plot

10 Ansichten (letzte 30 Tage)
Nurul Ain Basirah Zakaria
Nurul Ain Basirah Zakaria am 16 Feb. 2021
Beantwortet: Cris LaPierre am 3 Mär. 2021
Hi how can I change the Jan to start at 0?

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 3 Mär. 2021
You can change the first point's y value from 105 to 0.
d=datetime(2020,1,1):calmonths:datetime(2020,12,1);
y = randi(160,[1,12])+100;
M = month(d,'shortname');
plot(categorical(M,M),y)
% change the first point to 0
y(1)=0;
plot(categorical(M,M),y)

Weitere Antworten (0)

Kategorien

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by