[Matplotlib-users] How to continually open a matplotlib plot in the same location?

How to continually open a matplotlib plot in the same location?

image001.png

I’ve looked here and here trying to figure out how to make my matplotlib plot open in the same window location EVERY TIME. I’m using TkAgg for my backend, and using the code below I can only get the FIRST plot to open in the set location. When the program loops back and runs this part again, then the plot opens in a different location. I’m using Windows 10, Python 3.7.7 64-bit through Visual Studio Code.

fig = plt.figure(5)

figManager = plt.get_current_fig_manager()

figManager.window.wm_geometry(“1000x600+0+0”)

I figured it out. It was the interactive plot plt.ion() and it was screwing things up!

I did a quick screen capture so you can see how the graph opens in a new location

https://imgur.com/gallery/mfT8FqQ

···

From: Matplotlib-users matplotlib-users-bounces+abillings=axustech.com@python.org On Behalf Of Anthony Billings
Sent: Friday, February 26, 2021 9:59 AM
To: matplotlib-users@python.org
Subject: [Matplotlib-users] How to continually open a matplotlib plot in the same location?

How to continually open a matplotlib plot in the same location?

image001.png

I’ve looked here and here trying to figure out how to make my matplotlib plot open in the same window location EVERY TIME. I’m using TkAgg for my backend, and using the code below I can only get the FIRST plot to open in the set location. When the program loops back and runs this part again, then the plot opens in a different location. I’m using Windows 10, Python 3.7.7 64-bit through Visual Studio Code.

fig = plt.figure(5)

figManager = plt.get_current_fig_manager()

figManager.window.wm_geometry(“1000x600+0+0”)