using XtickLabel with fractions and integer numbers
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sermet
am 11 Jan. 2017
Bearbeitet: Sean de Wolski
am 11 Jan. 2017
time=[1:1:24];
interval_x_axis=0.5;
set(gca,'XtickLabel',time(1:interval_x_axis:end))
% it gives "Warning: Integer operands are required for colon operator when used as index".
How can I show 1-1.5-2-2.5 on the x axis within plot?
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 11 Jan. 2017
Bearbeitet: Sean de Wolski
am 11 Jan. 2017
You can't index into a vector with decimals, i.e. x.5.
time=[1:1:24];
plot(time)
interval_x_axis=0.5;
set(gca,'XTick',time(1):interval_x_axis:time(end))
My guess is you want something like this.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations 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!