Untitled
unknown
plain_text
a year ago
368 B
5
Indexable
import matplotlib.pyplot as plt
import numpy as np
ages = np.array([57, 45, 35, 30, 31, 28, 32, 44, 35, 31])
# Histogram
plt.hist(ages, bins=5) # Adjust 'bins' as needed
plt.xlabel("Age")
plt.ylabel("Frequency")
plt.title("Histogram of Respondent Ages")
plt.show()
# Box plot
plt.boxplot(ages)
plt.ylabel("Age")
plt.title("Box Plot of Respondent Ages")
plt.show()
Editor is loading...
Leave a Comment