Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this program prints out an area graph
- # based on 10 different random values
- # import the python libraries for plotting
- import matplotlib.pyplot as plt
- import numpy as np
- # create the list to store the legend values
- list = []
- # loop through 10 times to create 10 separate lines on the graph
- # with random values between 30 and 300
- for b in range(0, 10):
- x = np.arange(10)
- y = np.random.random_integers(30, 300)
- list.append(y)
- plt.plot(list)
- # fill in the area
- plt.fill_between(x, list)
- print list
- # display the area graph
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment