ipython and matplotlib-0.83

I have a problem with ipython and the new version of

    > matplotlib (I'm using a cvs version but there are no
    > change since yesterday so I suppose that is the version
    > 0.83). When I did a:

I assume you are working with ipython CVS? Try replacing this code block
in IPython/Shell.py

        # We need to detect at runtime whether show() is called by the user.
        # For this, we wrap it into a decorator which adds a 'called' flag.
        backend.draw_if_interactive = flag_calls(backend.draw_if_interactive)

        # This must be imported last in the matplotlib series, after
        # backend/interactivity choices have been made
        try:
            import matplotlib.pylab as pylab
            self.pylab = pylab
            self.pylab_name = 'pylab'
        except ImportError:
            import matplotlib.matlab as matlab
            self.pylab = matlab
            self.pylab_name = 'matlab'

with this

        # This must be imported last in the matplotlib series, after
        # backend/interactivity choices have been made
        try:
            import matplotlib.pylab as pylab
            self.pylab = pylab
            self.pylab_name = 'pylab'
        except ImportError:
            import matplotlib.matlab as matlab
            self.pylab = matlab
            self.pylab_name = 'matlab'

        # We need to detect at runtime whether show() is called by the user.
        # For this, we wrap it into a decorator which adds a 'called' flag.
        self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)

Does that help?

JDH

John Hunter wrote:

"Humufr" == Humufr <humufr@...136...> writes:

    > I have a problem with ipython and the new version of
    > matplotlib (I'm using a cvs version but there are no
    > change since yesterday so I suppose that is the version
    > 0.83). When I did a:

I assume you are working with ipython CVS? Try replacing this code block
in IPython/Shell.py

        # We need to detect at runtime whether show() is called by the user.
        # For this, we wrap it into a decorator which adds a 'called' flag.
        backend.draw_if_interactive = flag_calls(backend.draw_if_interactive)

        # This must be imported last in the matplotlib series, after
        # backend/interactivity choices have been made
        try:
            import matplotlib.pylab as pylab
            self.pylab = pylab
            self.pylab_name = 'pylab'
        except ImportError:
            import matplotlib.matlab as matlab self.pylab = matlab
            self.pylab_name = 'matlab'

with this

        # This must be imported last in the matplotlib series, after
        # backend/interactivity choices have been made
        try:
            import matplotlib.pylab as pylab
            self.pylab = pylab
            self.pylab_name = 'pylab'
        except ImportError:
            import matplotlib.matlab as matlab self.pylab = matlab
            self.pylab_name = 'matlab'

        # We need to detect at runtime whether show() is called by the user.
        # For this, we wrap it into a decorator which adds a 'called' flag.
        self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)

Does that help?

John, is this due to the recent __init__ patch in matplotlib? I haven't committed any of that, as I am in the middle of the cvs->svn transition at ipython's site, and without net access at home (moving), so I'm sort of crippled right now.

If this is going to become a real problem for mpl users, I'll do my best to push out an update soon, but it may take me a few days.

Cheers,

f