In my code, I have it so that first images are plotted and then the user is asked to choose an image.
But when I run the cell, the user is first asked to choose an image and then the images are plotted. Not sure why.
In my code, I have it so that first images are plotted and then the user is asked to choose an image.
But when I run the cell, the user is first asked to choose an image and then the images are plotted. Not sure why.
Jupyter will render the plot after everthing else if it is running in 'inline' mode. I can't reproduce what you have exactly but take the following example:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,10,10)
y = 5*x +2
plt.plot(x,y)
print('Text is here first even though the plot call comes last')
The output of this looks like:
So the plot is rendered last. Instead if we add '%matplotlib notebook' to the start. The plot will be rendered interactively and before the text. If you want to switch back just change it to '%matplotlib inline'. There are a number of other backend plotting options that are worth exploring.