Interaction of matplotlib with ipython (not notebook)

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

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
Matplotlib-users at python.org
Matplotlib-users Info Page

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

···

On Tue, Jul 30, 2019 at 11:01 AM Juan <fiolj at yahoo.com> 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
> Matplotlib-users at python.org
> Matplotlib-users Info Page
>

--
Those who don't understand recursion are doomed to repeat it