Untitled

 avatar
unknown
plain_text
5 months ago
688 B
1
Indexable
import matplotlib.pyplot as plt

# Data for Exercise 1.3.5
juveniles = [200, 30, 0]
adults = [100, 50, 25]
labels = ['(200, 100)', '(30, 50)', '(0, 25)']

# Create a scatter plot
plt.figure(figsize=(6,6))
plt.scatter(juveniles, adults, color='blue')

# Label each point
for i, label in enumerate(labels):
    plt.text(juveniles[i] + 2, adults[i], label, fontsize=12)

# Set labels and title
plt.xlabel('Number of Juveniles', fontsize=12)
plt.ylabel('Number of Adults', fontsize=12)
plt.title('State Space for Black Bear Population (Juveniles vs Adults)', fontsize=14)

# Set axis limits to fit points well
plt.xlim(-10, 220)
plt.ylim(0, 110)

# Display the plot
plt.grid(True)
plt.show()
Editor is loading...
Leave a Comment