title: How to set the axis scale and ticklabels using matplotlib object oriented API
body: <p>I would need some help with plotting in Matplotlib.pyplot under Python2.7!</p>
  
  <p>I want to generate a plot with the following x-axis:</p>
  
  <p><a href="http://i.stack.imgur.com/zcosX.jpg" rel="nofollow">x-axis as it should be</a></p>
  
  <p>I got so far by using <code>myaxis.set_xticks([0,0.5,1,2,4,6,8])</code> and it looks good, but if I want to create **an logarithmic x-axis* **, then my axis labels look like this!</p>
  
  <p><a href="http://i.stack.imgur.com/kGtse.jpg" rel="nofollow">wrong x-axis labels</a></p>
  
  <p>What can I do to have both a log-scaled x-axis and integer formated labels (not logarithmic values as labels either!). <strong>Please read the note regarding to the log-scale!!!</strong></p>
  
  <p>While browsing Stackoverflow I found the following similar question, but nothing of the suggestions worked for me and I do not know what I did wrong.</p>
  
  <p><a href="https://stackoverflow.com/questions/17165435/matplotlib-show-labels-for-minor-ticks-also">Matplotlib: show labels for minor ticks also</a></p>
  
  <p>Thanks! </p>
  
  <p><strong>Note:</strong> This plot is called <strong>Madau-Plot</strong> (<em>see:adsabs[dot]harvard[dot]edu Madau (1998) DOI=10.1086/305523</em>). It is common to plot it log-scales and show the z=0.0 value although the axis is log-scaled axis and <code>log10(0)=Error</code>. I definitely want to point out here that this is common use in my field but should not be applied one to one to any other plots. <strong>So actually the plot is made with a trick! You plot (1+z) [1,1.5,2,3,5,7,9]] and then translate the x-axis to the pure z-values 0.0 &lt; z 8.0!</strong> So what I need to find is how to set xticks to the "translated" values ([0,0.5,1,2,4,6,8])</p>