title: setugid() error using matplotlib with apache and django
body: <p>I'm using matplotlib in a Django app served through apache on Mac OS X 10.7.5 but I can't get it to plot a figure for me. I've imported import <code>matplotlib.pyplot as plt</code>, and the line in my view,</p>
  
  <pre><code>plt.plot(x, y)
  </code></pre>
  
  <p>(<code>x</code> and <code>y</code> are numpy arrays) is causing the error</p>
  
  <pre><code>2013-01-23 16:39:16.731 httpd[381:203] The application with bundle ID (null) is running setugid(), which is not allowed.
  </code></pre>
  
  <p>in my apache error_log. I'm afraid I don't know what <code>setugid()</code> is, or how to make running it allowed for my app.
  My <code>$MPLCONFIGDIR</code> is set to <code>/tmp/.mplconfig</code> and apache as user _www has written a couple of empty directories to it, so that seems to be working OK.
  Can anyone give me a clue?</p>
  
  <p>Update: if I</p>
  
  <pre><code>from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
  from matplotlib.figure import Figure
  </code></pre>
  
  <p>and set up a figure, subplot and axes (the whole caboodle), I can savefig() without an error... what extra permissions does pyplot need?</p>