Using matplotlib - Grand Valley State University

[Pages:1]Using matplotlib

1. Simple graphs with matplotlib ? matplotlib plotting object: import matplotlib.pyplot as plt ? create a graph: plot() ? display the graph: show()

import math import matplotlib.pyplot as plt x = [] y = [] for i in range(-315, 315):

val = i/100.0 x.append(val) y.append(math.sin(val)) print (x) print (y) plt.plot(x, y) plt.show()

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download