[text] b

Viewer

  1. import matplotlib.pyplot as plt
  2.  
  3. # Given data
  4. hours_studying = [0.62, 1.50, 0.34, 0.97, 3.54, 0.69, 1.53, 0.32, 1.94, 1.25, 1.42, 3.07, 3.99, 1.73, 1.29]
  5. class_performance = [2.02, 4.62, 2.60, 1.59, 4.67, 2.52, 2.28, 1.68, 2.50, 4.04, 2.63, 3.53, 3.90, 2.75, 2.95]
  6.  
  7. # Creating scatter plot
  8. plt.figure(figsize=(8, 6))
  9. plt.scatter(hours_studying, class_performance, color='blue', alpha=0.7)
  10.  
  11. # Adding labels and title
  12. plt.title('Hours Studying vs Overall Class Performance')
  13. plt.xlabel('Hours Studying')
  14. plt.ylabel('Overall Class Performance')
  15.  
  16. plt.grid(True)
  17. plt.show()
  18.  

Editor

You can edit this paste and save as new:


File Description
  • b
  • Paste Code
  • 04 May-2024
  • 586 Bytes
You can Share it: