title: python matplotlib tick numbers collapsed
body: <p>I am puzzled that the same code works for the first chart below but not for the second.  The code is:</p>
  
  <pre><code>def decorate_plot(self, title, ylabel="Exposure", xlabel="Time / Years", legend_loc="upper right"):
      self.ax.set_title(title)
      self.ax.set_xlabel(xlabel)
      self.ax.set_ylabel(ylabel)
      self.ax.legend(loc=legend_loc, shadow=True)
      self.ax.get_yaxis().set_major_formatter(
          matplotlib.ticker.FuncFormatter(lambda x, p: format(int(x), ',')))
  </code></pre>
  
  <p>Please how can I get the y-axis numbers on second chart to display correctly?  </p>
  
  <p>Axes ticks work here
  <img src="https://i.stack.imgur.com/LkEWp.png" alt="Axes ticks work here"></p>
  
  <p>But y-axis ticks collapse here
  <img src="https://i.stack.imgur.com/dRafl.png" alt="But y-axis ticks collapse here"></p>
  
  <p>The numeric data for the charts initially was string format and so I used list(Map(float, ...)) to convert to float.  As this worked for the first chart I was puzzled that the next chart y-axis ticks collapsed.  On checking the Locals window I think the culprit is "seq" which show the y-axis numeric data as string again.  The processing is in C++ and python is used for displaying results.  Source code is at <a href="https://github.com/opensourcerisk/engine/releases" rel="nofollow noreferrer">https://github.com/opensourcerisk/engine/releases</a>
  The two charts are in Examples_1 &amp; _2 directories and the plot code is in ore_examples_helper.py in Examples directory.</p>
  
  <p>Clearly odd that I can get the code to work for the first chart but not the second.  I managed to adjust the y-data as chart 2 plots ok.</p>
  
  <p>The charts seem to be set up in this code but I cant see where data type gets specified.  Shouldnt Matplotlib automatically assume that numeric data for plots would not be in string format but in a numeric format?</p>
  
  <pre><code>    def setup_plot(self, filename):
          self.fig = plt.figure(figsize=plt.figaspect(0.4))
          self.ax = self.fig.add_subplot(111)
          self.plot_name = "mpl_" + filename
  </code></pre>
  
  <p>Below is the Locals (my IDE is VS2017).  Ideally this data would be set to float on entering python but as I am not familiar with the code, is there a way to convert "seq" to float as a workaround please?  </p>
  
  <p><a href="https://i.stack.imgur.com/UMm2W.png" rel="nofollow noreferrer">Seq data is set to string</a></p>