Jul-04-2020, 10:57 AM
If this running outside a environment like Sypder/REPL/Notebook.
The need to use
The need to use
plt.show()
to show the plot.import matplotlib.pyplot as plt def plotgrh(): fig, ax = plt.subplots(1,2) print("I am plotting graph") plt.plot([6,1,8,4],[4,7,2,1]) # Uncomment for save plot #plt.savefig('Graph.png') plt.show() print("Graph plotted") plotgrh()