15 - PracticeC (4) - JupyterLab
15 - PracticeC (4) - JupyterLab
✅ Bhuvi Narkhede
✏ Calculate what the population projections for growth would be if the deer population
was more inline with historical models for wild animal growth. Consider the following more
common values of the growth rate:
Put the lines for all five growth models for the deer population on the same plot. This time,
add a legend to your graph that includes what each graph represents. Use plt.legend()
to add a legend to the plot.
In order for your graph to have an appropriate legend, make sure that each of your curves
has a label parameter at the end of the plot command.
P0 = 2400
K = 3800
time_list = list(range(0, 31))
plt.figure(figsize=(10, 6))
plt.plot(time_list, first_rate, label='k_R = 0.01')
plt.plot(time_list, second_rate, label='k_R = 0.03')
plt.plot(time_list, third_rate, label='k_R = 0.05')
plt.plot(time_list, fourth_rate, label='k_R = 0.07')
localhost:8888/lab/tree/15_PracticeC.ipynb? 1/4
10/18/24, 7:59 PM 15_PracticeC
Look back at your graph above. Did you remember to add titles and labels to the axis? If not, go back and do that
now.Understanding the implications of your data is an important part of data analysis. Think about the different growth projections
in your graph above. What types of changes could cause the deer population to be more inline with one of the smaller growth
rates? Write your ideas and insight here. (Do a little research so your answers are based in factual knowledge.)
Without changing the years of calculation, modify the plot so the viewable part of your
graph is only the years from 2012 - 2022. The goal is to change the viewable area to
reduce the x_axis to only include these years. Scale the y_axis accordingly, based on the
data. This can be done using the xlim and ylim functions in pyplot . Take a few
minutes to explore the internet for information on how these two commands can be
used.
Plot each year as an individual point instead of the lines/curves used previously. Each
growth rate should be represented by a different figure and color. The figures should
include a triangle, a star, a circle, and other shapes of your choosing.
localhost:8888/lab/tree/15_PracticeC.ipynb? 2/4
10/18/24, 7:59 PM 15_PracticeC
Ensure that the plot has all of the appropriate labels, titles, and legend.
P0 = 2400
K = 3800
time_list = list(range(0, 31))
plt.figure(figsize=(10, 6))
plt.xlim(2, 12)
plt.ylim(2400, 3500)
plt.legend()
plt.show()
localhost:8888/lab/tree/15_PracticeC.ipynb? 3/4
10/18/24, 7:59 PM 15_PracticeC
localhost:8888/lab/tree/15_PracticeC.ipynb? 4/4