diff --git a/_posts/2023-08-13-half-marathon.md b/_posts/2023-08-13-half-marathon.md new file mode 100644 index 0000000..b43606f --- /dev/null +++ b/_posts/2023-08-13-half-marathon.md @@ -0,0 +1,58 @@ +--- +title: My First Half Marathon! +layout: post +image: /assets/blog/running/time_vs_distance.svg +social_image: /assets/blog/running/time_vs_distance.png +alt: A scatter graph of run time vs run distance for all my runs on strava. It shows that I mainly run between 5 and 6 min per kilometer, regardless of distance +--- + +I recently ran my first half marathon! I'm also signed up for a full marathon in October. 😬 + +Anyway, to celebrate the occasion and because I have now have a reason to think about how fast I might run a particular distance. I had a look at my historical run data. There's a great website called [statshunter](https://www.statshunters.com/) that you can authorise to Strava and from which you can download a little csv of all your runs. The first logical thing I could think to do is to see how fast I tend to run different distances. + +
+ +
+So it's pretty much a straight line. This is telling me what I kinda already knew: I'm comfortable running between 5 and 7 mins/km and that's basically how fast I always run regardless of distance. +
+
+ +A friend lent me a huge running book which I'm going to dig through more but I suspect one of the conclusions will be a bit obvious: I could run those shorter distances a lot faster. + +That same friend also lent me a heart rate watch which I've been playing with. So the next thing I want to learn about is what type of heart rates you should target when you train for a particular event. + + +Code: + +```python +from matplotlib import pyplot as plt +import numpy as np +from datetime import datetime +import pandas as pd + +runs = pd.read_csv("runs.csv", parse_dates = ["Date"]) # Get this from statshunter.com + +f, (ax2, ax) = plt.subplots(nrows=2, figsize = (5,5), sharex = True, + gridspec_kw = dict(height_ratios = (1,2))) + +ax.set(ylabel = "Moving Time (mins)", xlabel = "Distance (km)") + +x = runs["Distance (m)"].values/1e3 +y = runs["Moving time"].values/60 + +dists = np.linspace(1, 25, 2) +for i in [5,6,7]: + mins_per_km = i * dists + ax.plot(dists, mins_per_km, color = "black", linestyle = "dotted", label = f"{i} min/km") + ax.text(25.5, 25*i, f"{i} min/km", va = "center") + +ax.annotate("Half Marathon!", (x[0], y[0]-1), (20, 50), arrowprops = dict(arrowstyle = "->")) + +ax.scatter(x, y, s=20, alpha = 0.6*fade_out_by_date(runs["Date"])) +for a in [ax, ax2]: a.spines[['right', 'top']].set_visible(False) + +ax2.hist(x, bins = 30, alpha = 0.5) +ax2.set(yticks=[], ylabel = "Frequency Density") + +f.savefig("time_vs_distance_plus_hist.svg", transparent=True) +``` \ No newline at end of file diff --git a/assets/blog/running/time_vs_distance.png b/assets/blog/running/time_vs_distance.png index 9c89636..bdae8f2 100644 Binary files a/assets/blog/running/time_vs_distance.png and b/assets/blog/running/time_vs_distance.png differ diff --git a/assets/blog/running/time_vs_distance.svg b/assets/blog/running/time_vs_distance.svg index bed3a6a..bc471f3 100644 --- a/assets/blog/running/time_vs_distance.svg +++ b/assets/blog/running/time_vs_distance.svg @@ -1,12 +1,12 @@ - + - 2023-08-02T12:59:46.857907 + 2023-08-13T16:29:09.322102 image/svg+xml @@ -21,27 +21,27 @@ - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + - + - + - + - + - + - + - + @@ -771,12 +771,12 @@ z - + - + - + - + @@ -824,7 +824,7 @@ z - + - - + - - - - + + + - + - - - - - - + + + @@ -1154,152 +1132,36 @@ z - + - - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + - - + + - - + + - - - - - + + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + - + - + + diff --git a/assets/blog/running/time_vs_distance_plus_hist.svg b/assets/blog/running/time_vs_distance_plus_hist.svg index c7d0b54..7a5b163 100644 --- a/assets/blog/running/time_vs_distance_plus_hist.svg +++ b/assets/blog/running/time_vs_distance_plus_hist.svg @@ -1,12 +1,12 @@ - + - 2023-08-01T14:24:44.788845 + 2023-08-13T16:20:50.140314 image/svg+xml @@ -21,309 +21,309 @@ - - - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - +" clip-path="url(#pd8b7aec6a1)" style="fill: #1f77b4; opacity: 0.5"/> - - + - + - + - + - + - + @@ -331,7 +331,7 @@ L 0 3.5 - + - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + @@ -1347,12 +1347,12 @@ z - + - + - + - + @@ -1400,7 +1400,7 @@ z - + - - + - + @@ -1544,12 +1544,12 @@ L -3.5 0 - + - + @@ -1558,12 +1558,12 @@ L -3.5 0 - + - + @@ -1572,12 +1572,12 @@ L -3.5 0 - + - + - + - + @@ -1613,12 +1613,12 @@ z - + - + @@ -1628,12 +1628,12 @@ z - + - + @@ -1643,12 +1643,12 @@ z - + - + @@ -1657,7 +1657,7 @@ z - + - + - + - + - - - + - + - + @@ -1879,17 +1879,17 @@ z - - - + - + + - - + + diff --git a/run.sh b/run.sh index aad51a1..47dce04 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -sleep 3 && open --url http://0.0.0.0:4000 & +sleep 5 && open --url http://0.0.0.0:4000 & bundle exec jekyll serve --draft --future \ No newline at end of file