title: Matplotlib pyplot axes formatter
body: <p>I have an image: </p>
  
  <p><img src="https://i.stack.imgur.com/6Xuwb.png" alt="enter image description here"></p>
  
  <p>Here in the y-axis I would like to get <code>5x10^-5 4x10^-5</code> and so on instead of <code>0.00005 0.00004</code>. </p>
  
  <p>What I have tried so far is: </p>
  
  <pre><code>fig = plt.figure()
  ax = fig.add_subplot(111)
  y_formatter = matplotlib.ticker.ScalarFormatter(useOffset=True)
  ax.yaxis.set_major_formatter(y_formatter)
  
  ax.plot(m_plot,densities1,'-ro',label='0.0&lt;z&lt;0.5')
  ax.plot(m_plot,densities2, '-bo',label='0.5&lt;z&lt;1.0')
  
  
  ax.legend(loc='best',scatterpoints=1)
  plt.legend()
  plt.show() 
  </code></pre>
  
  <p>This does not seem to work. The <a href="http://matplotlib.org/api/ticker_api.html">document page</a> for tickers does not seem to provide a direct answer. </p>