I am unable to display the .png file created by pyplot. I created the file in Microsoft Azure Jupyter Notebook. os.listdir() returns xx.png, so I know that the file was created. Yet, display xx.png returns invalid syntax. I have read about ten related posts on stackoverflow and tried numeros variations of the command, but nothing works. Here is the code I used to create the .png file. The command plt.show() shows the chart. I can open the .png file from the windows browser. When I run the program on my local computer it works fine.
My objective is to create and frequently update about 20 charts that I can call up and view on demand.
from IPython.display import display
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
y = [2,4,6,8,10,12,14,16,18,20]
x = np.arange(10)
fig = plt.figure()
ax = plt.subplot(111)
ax.plot(x, y, label='$y = numbers')
plt.title('Legend inside')
ax.legend()
fig.savefig('xx.png')