I noticed that whether or not we use the code "plt.show()", the plots, scatterplots, histograms still appear. Is there a point in using this line of code?
I didn't understand what the command "plt.clf()" does. It is supposed to clear out the previous plot so you can start afresh. But it seems like creating multiple plots one after the other works anyway. What is the a point to this command?
The following code should work for making a plot according to Datacamp, but it doesn't: "plt.plot(cars)
plt.show()" . cars is a dataframe. It returns an empty plot.
So does the following code for making a plot: "plt.yscale('log')
plt.show()"
This didn't work to save: cars['population'].plot(color='b', style='.-', legend=True)
plt.axis((0, 6, 500, 6000))
plt.savefig('C:/Users/Mihaela/Desktop/Economic Analysis/cars.jpg')
plt.show()
Why?