# generate data x=np.linspace(-1,1,100) # 100 points between -1 and 1; y=x*x # plot data plt.plot(x,y) plt.legend([
plt.xlabel('x') plt.ylabel('y') plt.axis([-1.2, 1.2, 0, 1.2]) plt.title(
plt.show() # show in windowplt.savefig('fig_example.pdf') # save to fileplt.close() http://matplotlib.org/faq/howto_faq.html https://en.wikipedia.org/wiki/Matplotlib |
Plot >