Task 9
Training intensity
Heart rate is a popular metric used to measure training intensity. Depending on age and fitness level, heart rates are grouped into different zones that people can target depending on training goals. A target heart rate during moderate-intensity activities is about 50-70% of maximum heart rate, while during vigorous physical activity it’s about 70-85% of maximum.
We'll create a distribution plot of my heart rate data by training intensity. It will be a visual presentation for the number of activities from predefined training zones.
Create a customized histogram for heart rate distribution.
Subset
df_run
from March 2015 through 2018 then select theAverage Heart Rate (bpm)
column. Assign the result todf_run_hr_all
.Create a plot with
plt.subplots()
, settingfigsize
to(8,5)
. Assign the result tofig, ax
.Create customized x-axis ticks with
ax.set_xticklabels()
. Set the parameterslabels
tozone_names
,rotation
to-30
, andha
to'left'
.Show the plot with
plt.show()
.
Last updated