title: Plotting on a log base 2 scale
body: <p>Following the recommendation in this <a href="https://stackoverflow.com/questions/3881492/select-a-different-base-for-a-logarithmic-plot-in-matlab">question</a>, I tried to plot the log2 values of my data and also display the tick labels on the horizontal and vertical axes as a power of 2. But I am not getting the desired tick labels along either axes. On both axes, I would have liked the tick labels to be displayed as integer powers of 2, i.e., on the x-axis: 3 and 4, on the y-axis: 0, -1, -2, -3, -4 and -5. Here is my code:</p>
  
  <pre><code>x = [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]
  Tcomm = [ 0.0357, 0.0515, 0.0745, 0.0956, 0.122, 0.1596, 0.2005, 0.2443, 0.2873, 0.3752, 0.4148, 0.5102, 0.5882 ]
  plot(log2(x), log2(Tcomm), 'ko')
  set(gca, 'XTickLabel',[])                      %# suppress current x-labels
  xlim([log2(8),log2(16)])
  xt = get(gca, 'XTick');
  yl = get(gca, 'YLim');
  str = cellstr( num2str(xt(:),'2^{%d}') );      %# format x-ticks as 2^{xx}
  hTxt = text(xt, yl(ones(size(xt))), str, ...   %# create text at same locations
  'Interpreter','tex', ...                   %# specify tex interpreter
  'VerticalAlignment','top', ...             %# v-align to be underneath
  'HorizontalAlignment','center');           %# h-aligh to be centered
  
  xlabel('N');
  ylim([log2(0.0357), log2(0.58825)])
  set(gca, 'YTickLabel',[])
  xt = get(gca, 'YTick');
  yl = get(gca, 'XLim');
  str = cellstr( num2str(xt(:),'2^{%d}') );      %# format x-ticks as 2^{xx}
  hTxt = text(xt, yl(ones(size(xt))), str, ...   %# create text at same locations
  'Interpreter','tex', ...                   %# specify tex interpreter
  'VerticalAlignment','middle', ...             %# v-align to be underneath
  'HorizontalAlignment','right');           %# h-aligh to be centered
  
  ylabel('CommunicationTime');
  title('(a)');
  </code></pre>