Interaction of matplotlib with ipython (not notebook)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Interaction of matplotlib with ipython (not notebook)

Neal Becker
I'm using ipython under emacs python (M-x run-python)

ipython arranges that plt.show() does nothing (does not pause).
Sometimes I want that, but sometimes I don't (e.g., my program is going to
generate an infinite number of plots).

How can I stop ipython from disabling plt.show() from pausing?

On a related note, I may want to save the figure output rather than drawing
to the screen.  When run under ipython, figures are drawn to the screen as
well as saved if savefig is used, or, same problem with

from mplcairo.multipage import MultiPage

    cm = MultiPage('best_circles_after.pdf')
    with cm as pdf:
     ....

anyone know how to prevent from drawing to the screen in this case?

Thanks,
Neal

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interaction of matplotlib with ipython (not notebook)

matplotlib - users mailing list
Hi Neal, I also use ipython from emacs, but the experience is highly
dependent on configuration. I am not sure I am understanding your question:

Are you talking about plt.ion(), plt.ioff() ?

plt.ion() is for interactive use
plt.ioff() for non-interactive. I use it to save the figures without
showing in the screen

Regards,
        Juan

El 30/7/19 a las 11:49, Neal Becker escribi??:

> I'm using ipython under emacs python (M-x run-python)
>
> ipython arranges that plt.show() does nothing (does not pause).
> Sometimes I want that, but sometimes I don't (e.g., my program is going to
> generate an infinite number of plots).
>
> How can I stop ipython from disabling plt.show() from pausing?
>
> On a related note, I may want to save the figure output rather than drawing
> to the screen.  When run under ipython, figures are drawn to the screen as
> well as saved if savefig is used, or, same problem with
>
> from mplcairo.multipage import MultiPage
>
>     cm = MultiPage('best_circles_after.pdf')
>     with cm as pdf:
>      ....
>
> anyone know how to prevent from drawing to the screen in this case?
>
> Thanks,
> Neal
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interaction of matplotlib with ipython (not notebook)

Neal Becker
Yet, looks like plt.ioff() is what I wanted, Thanks!

On Tue, Jul 30, 2019 at 11:01 AM Juan <[hidden email]> wrote:

>
> Hi Neal, I also use ipython from emacs, but the experience is highly
> dependent on configuration. I am not sure I am understanding your question:
>
> Are you talking about plt.ion(), plt.ioff() ?
>
> plt.ion() is for interactive use
> plt.ioff() for non-interactive. I use it to save the figures without
> showing in the screen
>
> Regards,
>         Juan
>
> El 30/7/19 a las 11:49, Neal Becker escribi??:
> > I'm using ipython under emacs python (M-x run-python)
> >
> > ipython arranges that plt.show() does nothing (does not pause).
> > Sometimes I want that, but sometimes I don't (e.g., my program is going to
> > generate an infinite number of plots).
> >
> > How can I stop ipython from disabling plt.show() from pausing?
> >
> > On a related note, I may want to save the figure output rather than drawing
> > to the screen.  When run under ipython, figures are drawn to the screen as
> > well as saved if savefig is used, or, same problem with
> >
> > from mplcairo.multipage import MultiPage
> >
> >     cm = MultiPage('best_circles_after.pdf')
> >     with cm as pdf:
> >      ....
> >
> > anyone know how to prevent from drawing to the screen in this case?
> >
> > Thanks,
> > Neal
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > [hidden email]
> > https://mail.python.org/mailman/listinfo/matplotlib-users
> >



--
Those who don't understand recursion are doomed to repeat it
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users