Advertisement
HugoCzerniawski

Linear Function

Dec 10th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. """
  2. Created on Mon Dec  9 21:19:49 2019
  3.  
  4. @author: Hugo
  5. """
  6.  
  7. import matplotlib.pyplot as plt
  8. import numpy as np
  9.  
  10. a = int(input('Please describe an integer a: '))
  11. b = int(input('Please describe an integer b: '))
  12.  
  13. x = np.linspace(-1, 10, 100)
  14. y = a*x+b
  15.  
  16. plt.plot(x, y, color = 'blue', label = 'Linear function a*x+b')
  17. plt.title('Linear function a*x+b')
  18. plt.xlabel('x', color = 'magenta')
  19. plt.ylabel('y', color = 'black')
  20. plt.legend(loc = 'lower right')
  21. plt.grid()
  22. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement