title: Reduce ticks & format axis labels in Matplotlib - scaling
body: <p>I have an array of subplots, but whenever I try to reduce the tick density or even change the format, the values seem to change. </p>
  
  <ol>
  <li>Is there a distinction here between the 'tick' and its value? How would I match the correct value to the tick if so?</li>
  </ol>
  
  <p>Here's a stand-alone plot that's right: <a href="https://i.stack.imgur.com/qtxn4.png" rel="nofollow noreferrer">France</a><br>
  <a href="https://i.stack.imgur.com/qtxn4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qtxn4.png" alt="enter image description here"></a></p>
  
  <p>Here's the (EDITED) code I'm trying: </p>
  
  <pre><code>import matplotlib as mpl
  from matplotlib.ticker import FormatStrFormatter
  
  f, axarr = plt.subplots(5,6,figsize=(30,30))
  for i in range(0,6):
      for j in range(0,5):
          # there are only 26 entries in ser
          if (4*i+j) &lt; 26:
              x = pp_gdp.loc[pp_gdp.index == ser.index[4*i+j],:].round(1)
              y = ser.loc[ser.index == ser.index[4*i+j],:].round(1)
              axarr[j,i].scatter(x,y)
              axarr[j,i].set_title(ser.index[4*i+j])
               xt = axarr[j,i].get_xticks()
          #axarr[j,i].set_xscale('linear')
          axarr[j,i].set_xticks([axarr[j,i].get_xticks()[0],int(len(axarr[j,i].get_xticks())/2), axarr[j,i].get_xticks()[-1]])
          axarr[j,i].set_xticklabels([x.values.min(),sorted(x.values)[0][int(len(xt)/2)],x.values.max()])
          yt = axarr[j,i].get_yticks()
          #axarr[j,i].set_yscale('linear')
          axarr[j,i].set_yticks([axarr[j,i].get_yticks()[0],int(len(axarr[j,i].get_yticks())/2), axarr[j,i].get_yticks()[-1]])
          axarr[j,i].set_yticklabels([y.values.min(),sorted(y.values)[0][int(len(yt)/2)],y.values.max()]);
  </code></pre>
  
  <p>Here's what I get if I comment out all the tick code, i.e. the default subplots:
  <a href="https://i.stack.imgur.com/ec9VO.png" rel="nofollow noreferrer">Default plot</a></p>
  
  <p>As you can see, it's far too dense to read.</p>
  
  <p>Here's what happens when I try nbins: </p>
  
  <pre><code>axarr[j,i].locator_params(tight=True, axis='y', nbins=10)
  axarr[j,i].locator_params(tight=True, axis='x', nbins=5)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/C1H53.png" rel="nofollow noreferrer">France nbins wrong</a><br>
  <a href="https://i.stack.imgur.com/C1H53.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C1H53.png" alt="enter image description here"></a></p>
  
  <p>Again, the values are wrong on both axes.</p>
  
  <p>Using the get_xticks and set_xticks as in the big code sample sort of works, but ruins the intuition of the plot. Also the scale is all wrong because of the way it keeps the 0.</p>
  
  <p>Very linear plots stay linear, but the slope is exaggerated. Plots a little more complicated lose their shape altogether, as in: 
  <a href="https://i.stack.imgur.com/DWPVs.png" rel="nofollow noreferrer">China now wrong</a></p>
  
  <p>The chart on the rightis much harder to understand, just because the scale isn't playing nicely. </p>
  
  <p>With my new</p>
  
  <p>Thanks,
  Roy</p>