MATLAB: How determine the scale of x label

graphicsgraphics issuesscale issuesx label issues

Hey, i'm trying to plot this data where the x label is the time, but i dont want this separation in the axis x, the current data already is in the format "..1958,1959,2000,2001.." anyone know how to solve this scale issues ?

Best Answer

Instead of bar(x, y), use
ax = gca;
t = 1:length(y);
bar(t, y, 'Parent', ax);
set(ax, 'XTick', t, 'XTickLabel', x);