Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #importando as paradas
- import numpy as np
- from statistics import mean
- import matplotlib.pyplot as plt
- #carregando as paradas
- porra = np.load('dois_processos_do_alunx_201706840005.npz')
- p1 = porra['X1']
- p2 = porra['X2']
- #fazendo as paradas
- def media_tempo(px, hell):
- pm = []
- for i in range(190):
- pm.append(mean(px[:,i]))
- # x axis values
- x = [i/4 for i in range(len(pm))]
- # corresponding y axis values
- y = pm
- # plotting the points
- plt.plot(x, y)
- # naming the x axis
- plt.xlabel('time')
- # naming the y axis
- plt.ylabel('m(t)')
- # giving a title to my graph
- plt.title(hell)
- # function to show the plot
- plt.show()
- def tri_real(px, i1, i2, i3):
- media_tempo(p1, 'process 1')
- media_tempo(p2, 'process 2')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement