SHARE
TWEET

Untitled

a guest Nov 22nd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #importando as paradas
  2. import numpy as np
  3. from statistics import mean
  4. import matplotlib.pyplot as plt
  5.  
  6. #carregando as paradas
  7. porra = np.load('dois_processos_do_alunx_201706840005.npz')
  8. p1 = porra['X1']
  9. p2 = porra['X2']
  10.  
  11. #fazendo as paradas
  12. def media_tempo(px, hell):
  13.     pm = []
  14.    
  15.     for i in range(190):
  16.         pm.append(mean(px[:,i]))
  17.  
  18.     # x axis values
  19.     x = [i/4 for i in range(len(pm))]
  20.     # corresponding y axis values
  21.     y = pm
  22.  
  23.     # plotting the points  
  24.     plt.plot(x, y)
  25.  
  26.     # naming the x axis
  27.     plt.xlabel('time')
  28.     # naming the y axis
  29.     plt.ylabel('m(t)')
  30.  
  31.     # giving a title to my graph
  32.     plt.title(hell)
  33.  
  34.     # function to show the plot
  35.     plt.show()
  36.    
  37. def tri_real(px, i1, i2, i3):
  38.    
  39. media_tempo(p1, 'process 1')
  40. media_tempo(p2, 'process 2')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top