scatter plot
unknown
python
25 days ago
407 B
2
Indexable
Never
import matplotlib.pyplot as plt # Data from the dataset age = [22, 31, 46, 43, 25, 62, 53, 32, 41, 25, 37, 39] num_jobs = [1, 2, 5, 4, 2, 9, 6, 3, 5, 1, 5, 6] # Creating the scatterplot plt.figure(figsize=(8, 6)) plt.scatter(age, num_jobs, color='blue') plt.title("Scatterplot of Age vs. Number of Jobs Since College") plt.xlabel("Age") plt.ylabel("Number of Jobs Since College") plt.grid(True) plt.show()
Leave a Comment