Make pyplot.pause not give focus to the figure window · Issue #11131 · matplotlib/matplotlib · GitHub
Skip to content

Make pyplot.pause not give focus to the figure window #11131

Description

@FSund

Bug report

Bug summary

I'm using matplotlib.pyplot.pause() to update a plot in a loop, mostly for debugging purposes. On my old matplotlib version (maybe 2.0.2, not sure) this worked fine, but after updating to 2.2.2 the pause function seems to have changed behaviour. Previously the figure window was left in the background, but now it is brought to the front and given focus. This makes hit hard to cancel the running script (Ctrl+C in Jupyter QtConsole), which I often use while debugging a script.

I know it is noted in the docs of pause that "This function is experimental; its behavior may be changed or extended in a future release.", but is there any way to bring back the old behaviour? Perhaps via a argument focus_window=False or something like that?

Code for reproduction

plt.figure()
# put the figure in the background, or below another window
plt.pause(2)
# now the figure will be on top, and have focus

Matplotlib version

  • Operating system: Windows 10 Pro build 1709
  • Matplotlib version: 2.2.2 (via Anaconda)
  • Matplotlib backend: Qt5Agg
  • Python version: 3.5.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions