I am new to matplotlib and I was watching this codes:
fig = plt.figure() ax = plt.axes() x = np.linspace(0, 10, 1000) ax.plot(x, np.sin(x));
but I know I can rewrite this code using:
x = np.linspace(0, 10, 1000) plt.plot(x,np.sin(x))
what is the usage of axes in the first code snippest?
Is there any profit to using this?
what is the difference between using plt and ax?
New contributor
someone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.