-1

I wrote some code to produce several plots, and they originally all came up as separate images on the windows task bar, which is what I wanted. Now the same code on the same machine presents the images one by one, and I have to close each one to see the next. (The button 'Forward to next view' is inoperable.)

I am guessing something about preferences sets where the plots appear. I want the plots to be in stand-alone windows. Thanks

Derek
  • 1

2 Answers2

0

I believe that you are running one plot after the other one, if this is the case (which makes sense), your program runs from top to bottom. Therefore, your program when it reaches the part of plotting a graph, it will execute that, and stop there until you close it, meanwhile it will remain standby.

Running code For example:

print(A + B)
print(B*C)

First it will run and execute -> print(A + B) Then after it finishes that computation, it will then go forward, to print:

print(B*C)

So I belive that is the reason behind why you cant see more than 1 plot at a time. I am not matplotlib expert, so I am not aware if there is any way of parallelism which will allow you to plot more than one plot at a time.

EDIT: I found something called "Subplots" Have a look at that

Also: Multiple plots with matplotlib in Python

Blanks
  • 108
  • 6
  • Indeed I have multiple matplotlib.pyplot calls, and re-issue the plt.show() command after each. – Derek Sep 02 '20 at 01:37
  • Yep, there you go, try to have a look at subplots, you may be able to plot one with multiple plots inside, so you could compare whatever data you have. – Blanks Sep 02 '20 at 01:41
0

The issue is caused by the 'run configuration' in Spyder being set to an external system terminal.

Solution: In Spyder (Python 3.7) select menu Run > Run configuration per file > Console > [radio button] 'Execute in a dedicated console'.

Note that while this setting appears to be also available in menu Tools > Preferences > Run, making the changes there has no effect even if Spyder is shut and restarted.

Also check other settings: Tools > Preferences > IPython console > Graphics > Graphics backend > select 'Automatic'.

Derek
  • 1