Saturday, 15 March 2014

plotting integer vs list using python -



plotting integer vs list using python -

i have made list using python programme contains 5000 elements. want plot list against list of integers looks [-2500:2500]. how can this?

using matplotlib:

import math import random import matplotlib.pyplot plt mylist = [math.sin(i/5000.*2*math.pi)+random.random()/10.0 in range(5000)] x = range(-2500, 2500) plt.plot(x, mylist) plt.savefig('test.png') plt.show()

there gallery of matplotlib examples (with source code) here. may help evaluate if matplotlib meets needs.

python list integer

No comments:

Post a Comment