title: Matplotlib, TypeError: ord() expected a character, but string of length 0 found
body: <p>I'm not a professional user of python, and I'm writing a (supposed) simple code with matplotlib to produce a histogram from a column of numbers and fit it with a Gaussian.</p>
  
  <p>I try to save the output with matplotlib.pyplot.savefig("figure.ps"), but I obtain this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "histo.py", line 85, in &lt;module&gt;
      plt.savefig("histo.ps")
    File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 471, in savefig
      return fig.savefig(*args, **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 1185, in savefig
      self.canvas.print_figure(*args, **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py", line 2021, in print_figure
      **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 469, in print_png
      FigureCanvasAgg.draw(self)
    File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 421, in draw
       self.figure.draw(self.renderer)
    File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
      draw(artist, renderer, *args, **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 898, in draw
      func(*args)
    File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
      draw(artist, renderer, *args, **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 1997, in draw
      a.draw(renderer)
    File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 55, in draw_wrapper
      draw(artist, renderer, *args, **kwargs)
    File "/usr/lib/pymodules/python2.7/matplotlib/axis.py", line 1042, in draw
      ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw, renderer)
    File "/usr/lib/pymodules/python2.7/matplotlib/axis.py", line 993, in _get_tick_bboxes
      extent = tick.label1.get_window_extent(renderer)
    File "/usr/lib/pymodules/python2.7/matplotlib/text.py", line 747, in get_window_extent
      bbox, info = self._get_layout(self._renderer)
    File "/usr/lib/pymodules/python2.7/matplotlib/text.py", line 309, in _get_layout
      ismath=ismath)
    File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 188, in get_text_width_height_descent
      renderer=self)
    File "/usr/lib/pymodules/python2.7/matplotlib/texmanager.py", line 608, in get_text_width_height_descent
      page = iter(dvi).next()
    File "/usr/lib/pymodules/python2.7/matplotlib/dviread.py", line 65, in __iter__
      have_page = self._read()
    File "/usr/lib/pymodules/python2.7/matplotlib/dviread.py", line 120, in _read
      byte = ord(self.file.read(1))
  TypeError: ord() expected a character, but string of length 0 found
  </code></pre>
  
  <p>the strangest thing is that with other columns or numbers it doesn't give me errors at all, but the column of numbers that gives me the error doesn't contain peculiar characters. I guess that the main error message is:</p>
  
  <pre><code>TypeError: ord() expected a character, but string of length 0 found
  </code></pre>
  
  <p>but I cannot understand why. The column contains 3000 numbers now, and typically I have run this code also with 10000 without problems. However, in this case, I noticed that if I reduce the column from 3000 to 2000 numbers, the code stops to complain
  Moreover, keeping the 3000 numbers column, if I don't try to save the output plot, the code doesn't crash either.</p>
  
  <p>Is there anyone who can give me some suggestions?</p>