title: Plot Binary Matrix in Pandas
body: <p>I have a dataframe (data) in pandas that has a datetimeindex (ca. 25.000 days of data) and 527 columns of IDs.</p>
  
  <pre><code>                  work_id_10  work_id_100  work_id_1007  work_id_1009
  concert_date
  1917-01-27             0            0             0             0
  1917-01-28             0            0             0             0
  1917-01-29             0            0             0             0
  1917-01-30             0            0             0             0
  1917-01-31             0            0             0             0
  </code></pre>
  
  <p>Each column ID indicates presence or absence of the particular ID with either 0 (absence) or 1 (presence). So, basically what I have is a matrix of binary values.</p>
  
  <p>I now want to create a plot that has all dates on the x-axis and for each column-ID the presences as points.I am using ipython.</p>
  
  <pre><code>%matplotlib
  import matplotlib.pyplot as plt
  fig, ax = plt.subplots()
  ax.set_yticklabels(data.index)
  ax.set_xticklabels(data.columns)
  plt.imshow/data, cmap='Greys', interpolation='none')
  </code></pre>
  
  <p>This gives me a MemoryError:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\Lib\lib-tk\Tkinter.py", line 1486, in __call__
      return self.func(*args)
    File "C:\Python27\Lib\lib-tk\Tkinter.py", line 533, in callit
      func(*args)
    File "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", lin
  e 365, in idle_draw
      self.draw()
    File "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", lin
  e 349, in draw
      FigureCanvasAgg.draw(self)
    File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", line
  469, in draw
      self.figure.draw(self.renderer)
    File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 59, in draw_wr
  apper
      draw(artist, renderer, *args, **kwargs)
    File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 1079, in draw
      func(*args)
    File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 59, in draw_wr
  apper
      draw(artist, renderer, *args, **kwargs)
    File "C:\Python27\lib\site-packages\matplotlib\axes\_base.py", line 2092, in d
  raw
      a.draw(renderer)
    File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 59, in draw_wr
  apper
      draw(artist, renderer, *args, **kwargs)
    File "C:\Python27\lib\site-packages\matplotlib\image.py", line 367, in draw
      self._draw_unsampled_image(renderer, gc)
    File "C:\Python27\lib\site-packages\matplotlib\image.py", line 321, in _draw_u
  nsampled_image
      self._get_unsampled_image(self._A, extent_in_ic, viewLim_in_ic)
    File "C:\Python27\lib\site-packages\matplotlib\image.py", line 219, in _get_un
  sampled_image
      x = (x * 255).astype(np.uint8)
  MemoryError
  </code></pre>
  
  <p>Is this the right approach, and why do I get a MemoryError?</p>
  
  <p>Thank you!</p>