fork download
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. # Generate a random normal distribution of grades
  5. np.random.seed(42)
  6. grades = np.random.normal(loc=75, scale=10, size=30) # Mean of 75, std deviation of 10, 30 students
  7.  
  8. # Plotting the histogram
  9. plt.figure(figsize=(8, 6))
  10. plt.hist(grades, bins=10, edgecolor='black', color='skyblue', alpha=0.7)
  11. plt.title('Class Grade Distribution', fontsize=14)
  12. plt.xlabel('Grades', fontsize=12)
  13. plt.ylabel('Frequency', fontsize=12)
  14. plt.grid(True)
  15. plt.show()
  16.  
Success #stdin #stdout #stderr 3.45s 70216KB
stdin
45
stdout
Standard output is empty
stderr
Fontconfig error: No writable cache directories