Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.