OK, I'm having a bad backend day (insert joke here).
Since I am on OSX, I decided to switch over to the CocoaAgg backend,
but it fails when trying to show a histogram, yielding the following
TypeError:
In [4]: from matplotlib import use
In [5]: use('CocoaAgg')
In [6]: from pylab import hist, show
In [7]: from numpy import random
In [8]: x = random.exponential(2, 1000)
In [9]: hist(x)
Out[9]:
(array([545, 230, 117, 59, 18, 15, 11, 1, 3, 1]),
array([ 2.99606603e-03, 1.52977050e+00, 3.05654494e+00,
4.58331937e+00, 6.11009381e+00, 7.63686824e+00,
9.16364268e+00, 1.06904171e+01, 1.22171915e+01,
1.37439660e+01]),
<a list of 10 Patch objects>)
In [10]: show()
···
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/chris/Projects/Occupancy-abundance Manuscript/<ipython console>
in <module>()
/Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py
in show()
44 def show():
45 for manager in Gcf.get_all_fig_managers():
---> 46 manager.show()
47
48 def draw_if_interactive():
/Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py
in show(self)
203 mplBundle,
204 False)
--> 205 NSApplication.sharedApplication().run()
206
207
/Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py
in startWithBundle_(self, bundle)
179 def startWithBundle_(self, bundle):
180 #NSApplicationLoad()
--> 181 if not
bundle.loadNibFile_externalNameTable_withZone_('Matplotlib.nib', {},
None):
182 print >>sys.stderr, 'Unable to load Matplotlib Cocoa UI!'
183 sys.exit()
/Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py
in awakeFromNib(self)
79
80 self.plotView.setImageFrameStyle_(NSImageFrameGroove)
---> 81 self.plotView.image = NSImage.alloc().initWithSize_((0,0))
82 self.plotView.setImage_(self.plotView.image)
83
TypeError: cannot change a method
--
Christopher J. Fonnesbeck
+ Fish & Wildlife Research Institute (FWC)
+ 727.235.5570