Advertisement
ndburrus

plot IETSilencer

Apr 20th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. // code provided with inquiry
  2. fig1 = plt.figure()
  3. fig2 = plt.figure()
  4. fig3 = plt.figure()
  5. ax1 = fig1.add_subplot(1, 1, 1)
  6. ax2 = fig2.add_subplot(2, 1, 1)
  7. ax3 = fig2.add_subplot(2, 1, 2)
  8. sd = [ax1, ax2, ax3]
  9. for i in range(3):
  10.  
  11. linreg = np.polyfit(averagepower1, LAB[i], 1)
  12.  
  13. function = np.poly1d(linreg)
  14.  
  15. slope, intercept, r_value, p_value, std_err = scipy.stats.linregress(averagepower1, LAB[i])
  16.  
  17. x_value = np.linspace(0, max(averagepower1), 10)
  18. y_value = function(x_value)
  19. sd[i].plot(x_value, y_value, plotcolors[i])
  20. sd[i].text(x = max(averagepower1) + 1, y = np.mean(LAB[i]), s = 'Hello')
  21. sd[i].text(x = max(averagepower1) + 1, y = np.mean(LAB[i]) - 1, s = 'y=' + str(function) + "\nR^2 = " + str(r_value ** 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement