wasted an hour trying to get matplotlib to respect cmd+q on a mac. gave up, just output to pdf and use preview.