Matplotlib cannot create a graph

 0 Hello! Using www.sagenb.com I typed the following code in the cell of my worksheet: import matplotlib.pyplot as plt plt.plot([1, 3, 2, 4]) plt.show()  Unfortunately there isn't any graph under the cell. What should I do? Thanks. asked Jul 07 '12 AndreWin 23 ● 1 ● 2 ● 7

 5 You just need to modify your last line. import matplotlib.pyplot as plt plt.plot([1, 3, 2, 4]) plt.savefig('test.png')  You might want to include x-coordinates to the get plot you want. import matplotlib.pyplot as plt plt.plot([1,2,3,4],[1, 3, 2, 4]) plt.savefig('test.png')  Also, you can get a nice plot in Sage with list_plot that might do the job for you. posted Jul 07 '12 calc314 1820 ● 3 ● 19 ● 51 Thank you very much for you answer!AndreWin (Jul 07 '12)points(...) or line(...,linestyle='') are also good ideas.kcrisman (Jul 07 '12)

[hide preview]