On 08/24/2011 11:07 AM, Grahame Bowland wrote: > Hi everyone > > I've found a few problems in the current matplotlib-py3 branch in the > _macosx.c code. I've put the fixes in a fork here: > https://github.com/grahame/matplotlib-py3 > I saw a pull request for a similar patch with a lot of comments that > seems to be stuck, so I thought I'd ask here what to do. It'd be great > to get the master branch working on Mac.
I was worried about accepting the changes without a Mac to test them on, and hoping that Michiel de Hoon (the Mac backend author) would have some comments. Maybe we can convince one of the other developers on this list who has a Mac to have a look. > Another thing - I think I've found a str/bytes bug which I can't > figure it out. I've attached the code, if I run it on my machine I get > this output: > > Traceback (most recent call last): > File "crash.py", line 24, in<module> > fig.canvas.print_figure(open('test.png', 'wb'), bbox_inches='tight') > File > "/opt/shrubbery/lib/python3.2/site-packages/matplotlib/backend_bases.py", > line 1951, in print_figure > bbox_inches = self.figure.get_tightbbox(renderer) > File "/opt/shrubbery/lib/python3.2/site-packages/matplotlib/figure.py", > line 1292, in get_tightbbox > for ax in self.axes: > File "/opt/shrubbery/lib/python3.2/site-packages/matplotlib/figure.py", > line 290, in _get_axes > return self._axstack.as_list() > File "/opt/shrubbery/lib/python3.2/site-packages/matplotlib/figure.py", > line 59, in as_list > ia_list = [a for k, a in self._elements] > File "/opt/shrubbery/lib/python3.2/site-packages/matplotlib/figure.py", > line 59, in<listcomp> > ia_list = [a for k, a in self._elements] > TypeError: string argument expected, got 'bytes' > > It's definitely something to do with the bbox_inches='tight' argument, > if I take that out everything works. Using the debugger I can't see > anything in any stack frame that explains the traceback - really odd! > Can you file an issue for this in the matplotlib-py3 github project? I'm busy getting the matplotlib 1.1.x release finished up at the moment, and don't have a working environment for Python 3 right now. I'd hate for this bug to fall through the cracks. Cheers, Mike ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel