I am learning how to use matplotlib now. From what I read, it seems the plot() function should be creating the plot and show() should display it. However, when I run the following, the display occurs on the plt.plot() line, not plt.show():
In [1]: import matplotlib.pyplot as plt
In [2]: %matplotlib inline
In [3]: plt.plot()
Out[3]: []
In [4]: plt.show()
The output above displays the empty plot after plot.plot(), but plt.show() does nothing. I am using Spyder with the iPython console. Running the code through the editor yields the same result. Am I misunderstanding what each function does individually or if I am not getting the correct results. Apologies if this is a stupid question.
For a bit of clarity:
My problem is not that the plot does not display. The plot displays perfectly! My issue is that so far, it seems the plt.show() function does not do anything. I can run my program, create a plot with plt.plot(x,y), change parameters such as the labels, and it displays as intended even if I completely omit plt.show(). plt.show() seems to have no functionality as it stands which is my issue.