I'm running this in the current version of Jupyter.
One of my cells contains the following.
import matplotlib.pyplot as plt
def main():  
    a_list = list(range(20))
    plt.plot(a_list)  
    plt.show()
main()    
When I run kernel > Restart & Run All the only output I get is a plot figure: <matplotlib.figure.Figure at 0x1bd35aa7a20> .
When I run the cell directly with the Run button, I get the expected plot. 
When I move main() to its own cell and then run kernel > Restart & Run All I get the expected plot.
I would appreciate help in understanding what's going on.
 
    