How can I control xticklabel?
1 view (last 30 days)
Walter Roberson on 15 Dec 2016
That would happen automatically.
x = datenum('Jan 17, 2016') : datenum('Jan 23, 2016');
y = mod(x, 4);
If the difficulty is with it automatically putting the label in scientific notation then:
In R2015a or later (might need R2015b):
ax = gca;
ax.XAxis.Exponent = 0;
In earlier versions (including R2014b, which did not have the Numeric Ruler properties yet even though it was HG2):
set(gca,'XTickLabel', cellstr( num2str( reshape(get(gca,'XTick'),,1) ) ) )