title: Python OSError: [Errno 24] Too many open files
body: <p>I use Ipython Notebook on Mac OS 10.11.2. I run Python 3.5.1 and Matplotlib 1.5.1 and Seaborn version 0.6.0:</p>
  
  <pre><code>%matplotlib inline
  
  import matplotlib.pyplot as plt
  
  import seaborn as sns
  </code></pre>
  
  <p>I recently started having issues when plotting using Matplotlib/Seaborn. After generating a few plots within the same notebook, the notebook cell where my latest plot is being generated crashes with the error: </p>
  
  <pre><code>OSError: [Errno 24] Too many open files: '/Library/Fonts/Arial.ttf'
  </code></pre>
  
  <p>I am still able to run other cells but the same error is raised every time I try to plot something within this notebook until I restart it. </p>
  
  <p>I tried increasing the files limit by running:</p>
  
  <pre><code>sudo launchctl limit maxfiles 10000000 10000000
  </code></pre>
  
  <p>It seems to have helped a bit the issue persists. Any suggestion on how to solve the issue once and for all would be appreciated. Thanks ! </p>
  
  <p>Below is the exact output of the error:</p>
  
  <hr>
  
  <pre><code>OSError                                   Traceback (most recent call last)
  /Users/spfraib/anaconda/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/IPython/core/pylabtools.py in &lt;lambda&gt;(fig)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/IPython/core/pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in draw(self)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/figure.py in draw(self, renderer)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/axis.py in draw(self, renderer, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/axis.py in _get_tick_bboxes(self, ticks, renderer)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/text.py in get_window_extent(self, renderer, dpi)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/text.py in _get_layout(self, renderer)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in get_text_width_height_descent(self, s, prop, ismath)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/mathtext.py in parse(self, s, dpi, prop)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/mathtext.py in __init__(self, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/mathtext.py in __init__(self, *args, **kwargs)
  
  /Users/spfraib/anaconda/lib/python3.5/site-packages/matplotlib/mathtext.py in __init__(self, default_font_prop, mathtext_backend)
  
  OSError: [Errno 24] Too many open files: '/Library/Fonts/Arial.ttf'
  </code></pre>