This is a MWE of what I\'m after, adapted from this question:
from matplotlib.pyplot import plot, draw, show
def make_plot():
plot([1,2,3])
draw()
You may use plt.show(block=False), which gets rid of the blocking directly.
For your example, this could read
from matplotlib.pyplot import plot, show
def make_plot():
plot([1,2,3])
show(block=False)
print('continue computation')
print('Do something before plotting.')
# Now display plot in a window
make_plot()
answer = input('Back to main and window visible? ')
if answer == 'y':
print('Excellent')
else:
print('Nope')