title: Matplotlib logarithmic scale displayed as integers workaround does not work with a specified scale
body: <p><code>Matplotlib</code> inherently sets logarithmic scales to use scientific notation. If you want to avoid this you have to use a workaround such as the following minimal example:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib as mpl
  import numpy as np
  x=np.arange(100,110)
  y=np.arange(10)
  fig, axes = plt.subplots(1, 2, sharey=True, squeeze=False)
  axes = axes[0]
  axes[0].plot(x,y)
  axes[1].plot(x,y)
  for ax in axes:
       ax.set_yscale('log')
       ax.yaxis.set_major_formatter(mpl.ticker.ScalarFormatter())
  plt.show() 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YHz2t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YHz2t.png" alt="Output"></a></p>
  
  <p>This works fine under all cases and has been shown as a solution as under many questions such as <a href="https://stackoverflow.com/questions/46735745/how-to-control-scientific-notation-in-matplotlib">Example 1</a> <a href="https://stackoverflow.com/q/21920233">Example 2</a></p>
  
  <p>I have used this solution fine before. However there is another issue that I have not seen discussed. If you want to set a <code>ax.ylim(...)</code> this work around stops working</p>
  
  <p>Consider the following example (note the new line <code>ax.set_ylim(0,10)</code>):</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib as mpl
  import numpy as np
  x=np.arange(100,110)
  y=np.arange(10)
  fig, axes = plt.subplots(1, 2, sharey=True, squeeze=False)
  axes = axes[0]
  axes[0].plot(x,y)
  axes[1].plot(x,y)
  for ax in axes:
      ax.set_ylim(0, 10)
      ax.set_yscale('log')
      ax.yaxis.set_major_formatter(mpl.ticker.ScalarFormatter())
  
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tiqfA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tiqfA.png" alt="Error"></a></p>
  
  <h2>This is no longer the desired output.</h2>
  
  <p>Is there anyway to avoid this weird interaction?</p>