MATLAB: Do the axes only show one tick mark when I plot the data on logarithmic axes in MATLAB 6.5 (R13)

algorithmautoaxeslabel;labellinglogarithmicMATLABtick

I compare the two figures generated as a result of the following two commands:
figure(1)
axes('XScale', 'log', 'YScale', 'log', 'XLim', [10^2.06 10^2.14], 'YLim', [10^2.06 10^2.14'])
figure(2)
axes('XScale', 'log', 'YScale', 'log', 'XLim', [10^1.96 10^2.04], 'YLim', [10^1.96 10^2.04'])
In both figures, the axes cover the same distance (.08) in log10 space in both cases. However, in the first case, I see five tick marks on each axis at 10^{2.06, 2.08, 2.1, 2.12, 2.14}. In the second case I see only one tick mark at 10^2.

Best Answer

There is a bug in MATLAB 6.5 (R13) in the way that tick marks are automatically generated in certain situations.
As a workaround, the tick marks and labels can be set manually using the SET command as follows:
set(gca,'xtick',[10^1.96 10^1.98 10^2 10^2.02 10^2.04]);
set(gca,'xticklabel',{'10^1.96' '10^1.98' '10^2' '10^2.02' '10^2.04'})