On 1/14/07, Steve Chaplin <[EMAIL PROTECTED]> wrote: > Darren reported a "bug" in backend_gtkcairo.py which he has "fixed". My > view is that the lines > from matplotlib.backends import backend_cairo > from matplotlib.backends.backend_gtk import * > work fine when called from the Python prompt. They are using the > absolute package path and are correct and should not be "fixed" to use > relative imports (which is bad style). So if there is a bug it is > elsewhere and from the traceback it looked like ipython is involved. > > The traceback shows that this code is being executed > # a hack to keep old versions of ipython working with mpl > if 'IPython.Shell' in sys.modules: > new_figure_manager, draw_if_interactive, show = pylab_setup() > > which is ipython-specific code. > I don't usually use IPython, but I installed it today and ran a few > simple matplotlib plots with the GTKCairo backend and they worked OK! So > I can't offer more info, perhaps Darren can produce a minimal test case > to isolate the problem.
Those lines also work fine from an ipython prompt: In [1]: from matplotlib.backends import backend_cairo In [2]: from matplotlib.backends.backend_gtk import * The point is that for some bizarre reason, /inside/ the ipython/matplotlib initialization, Darren was seeing a problem. It may very well be that the real culprit is ipython, but after looking at the issue I can't see anything, and Darren also tried to understand it and failed. So given this, Darren found a solution by modifying matplotlib. Unless you can suggest a proper fix, I think we'll have for now to live with this, even if it's in principle not ideal. If none of us can figure out the real problem, at least Darren's solution works, so it's better than leaving the bug in place. Cheers, f ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel