title: Strange behaviour when rendering X-Axis ticks
body: <p>I'm rendering a chart with matplotlib through panda's <code>df.plot()</code> method, but somehow the tick labels on the X-Axis seem to be messed up. There seems to be a layer of numeric text above my &quot;real&quot; tick labels. I have no idea where this comes from. Strangely enough, this only happens in our production and staging environment, not in dev. Maybe it also has to do with gunicorn or django's dev server. Has somebody made this experience before?</p>
  <p>Here's the plot result:</p>
  <p><a href="https://i.stack.imgur.com/v2hWR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v2hWR.png" alt="plot output" /></a></p>
  <p>and this is the output when I clear the ticks with <code>.set_xticks([], [])</code>:</p>
  <p><a href="https://i.stack.imgur.com/qmWPI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmWPI.png" alt="plot output with cleared x-axis" /></a></p>
  <p>Here's a portion of my code, there's some abstraction but I think it should be understandable. <code>self.data</code> is a pandas dataframe. It outputs base64-encoded png data:</p>
  <pre class="lang-py prettyprint-override"><code>class Line(ChartElement):
      def draw(self):
          self._plot = self.data.plot(kind='line', color=self.colors)
          self._rotation = 'vertical'
          self._horizontalalignment='center'
          # self._plot.set_xticks([], [])
  
  # ...
  
  class ChartElement():
      # ...
      def base64(self):
          self.draw()
          figfile = BytesIO()
          if not self._plot:
              raise ValueError(&quot;Plot not generated.&quot;)
          if self._legend:
              self._plot.legend(self._legend, **self._legend_args)
  
              #plt.legend(self._legend, loc='upper center', bbox_to_anchor=(0.4, .05), ncol=5, fancybox=False, prop={'size': 6})
  
          plt.setp(self._plot.get_xticklabels(), rotation=self._rotation, horizontalalignment=self._horizontalalignment, fontsize=8)
          self._plot.set_ylabel(self.y_title)
          self._plot.set_xlabel(self.x_title)
          #plt.figure()
          fig = self._plot.get_figure()
          fig.autofmt_xdate()
          if self.size and isinstance(self.size, list):
              fig.set_size_inches(inch(self.size[0]), inch(self.size[1]))
          fig.savefig(figfile, format='png', bbox_inches='tight')
          figfile.seek(0)
          figdata_png = base64.b64encode(figfile.getvalue())
          plt.clf()
          plt.cla()
          plt.close('all')
          plt.close()
          return figdata_png.decode('utf8')
  
  </code></pre>