Matplotlib figures are always on top when plotting from the console

Answered

When I create plots in the interactive console using, for example:

    import numpy as np

    from matplotlib import pyplot as plt

    plt.plot(np.random.rand(100))

the figure window is above all other windows (not just PyCharm). If I try to minimize it it immediately jumps back up.

Is there some way to make the figure behave like any other window (i.e. start on top but can be behind other windows or minimized)?

4
11 comments

Hello, Naveh! Could you please specify your Pycharm version? Unfortunately, I'm not able to reproduce the problem with PyCharm 2017.1.5, for me the figure window behaves like any other window.

0
Avatar
Permanently deleted user

Sorry for the late reply. This is my system:

PyCharm Community Edition 2017.1.5
Build #PC-171.4694.67, built on July 4, 2017
JRE: 1.8.0_112-release-736-b21 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

I should also mention I've tried adding plt.show(block=True/False) to no avail.

0

Could you please check the issue with the latest Pycharm EAP build: https://www.jetbrains.com/pycharm/nextversion/? Does the problem remain?

0
Avatar
Permanently deleted user

Checked it now. I get the same behavior.

0

Hi Naveh! Please try to run the same program in the interactive console outside of PyCharm. Do you have the same problems with the window? Which matplotlib backend do you use?

0
Avatar
Permanently deleted user

Any progress? I am experiencing this problem. The window pop up for plt is always on top. Cant even minimize. Pycharm 2020.1. Mac 10.13.

 

0

Hello, 

 

Regrettably, this issue has not been fixed yet https://youtrack.jetbrains.com/issue/PY-28781 , please vote for it in order to increase its priority. 

 

Sorry for the inconvenience. 

0

I get the same problem on my 2021 Macbook air. my pycharm version is:

PyCharm 2021.1.1 (Professional Edition)
Build #PY-211.7142.13, built on April 21, 2021
Licensed to #####
You have a perpetual fallback license for this version.
Subscription is active until May 25, 2022.
Runtime version: 11.0.10+9-b1341.41 aarch64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 11.2.3
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8

0

I also have the same issue. Extremely annoying.

PyCharm 2021.2 (Community Edition)
Build #PC-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8

MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports)

0

Any updates on this, I am experiencing the same issue

0

Hello, 

 

The fix is in progress, expected in the next minor version. 

0

Please sign in to leave a comment.