Skip to content

Instantly share code, notes, and snippets.

@jakelevi1996
Last active August 7, 2024 09:59
Show Gist options
  • Save jakelevi1996/05c54c9a365c20c07b673b55c1dd5807 to your computer and use it in GitHub Desktop.
Save jakelevi1996/05c54c9a365c20c07b673b55c1dd5807 to your computer and use it in GitHub Desktop.
Plot climbing scores
import numpy as np
from jutility import plotting
scores_list = [
[25.0, 25.0, 24.9, 24.7, 99.6, ],
[24.9, 24.9, 25.0, 9.7, 84.5, ],
[24.4, 24.9, 9.8, 24.6, 83.7, ],
[25.0, 24.9, 24.8, 4.9, 79.6, ],
[9.8, 25.0, 9.8, 24.6, 69.2, ],
[9.8, 10.0, 24.5, 24.5, 68.8, ],
[24.8, 24.6, 10.0, 5.0, 64.4, ],
[5.0, 24.5, 10.0, 24.5, 64.0, ],
[4.8, 24.9, 9.4, 24.5, 63.6, ],
[5.0, 24.7, 24.9, 5.0, 59.6, ],
[0.0, 24.6, 4.7, 24.7, 54.0, ],
[4.7, 24.7, 10.0, 9.9, 49.3, ],
[5.0, 24.8, 9.7, 4.7, 44.2, ],
[4.9, 24.8, 5.0, 4.8, 39.5, ],
[4.8, 10.0, 10.0, 4.9, 29.7, ],
[5.0, 9.7, 9.8, 4.7, 29.2, ],
[4.6, 9.9, 9.7, 4.2, 28.4, ],
[0.0, 4.4, 5.0, 3.8, 13.2, ],
[0.0, 4.8, 5.0, 0.0, 9.8, ],
[0.0, 0.0, 0.0, 0.0, 0.0],
]
scores = np.array(scores_list)
mp = plotting.MultiPlot(
*[
plotting.Subplot(
plotting.Hist(scores[:, i], np.arange(27)),
title="Boulder %i" % (i+1),
)
for i in range(4)
],
title="Women's Olympic bouldering semifinal",
top_space=0.15,
figsize=[10, 6],
)
mp.save("boulders")
plotting.plot(
plotting.Hist(scores[:, 4], np.arange(102)),
plot_name="Women's Olympic bouldering semifinal overall scores",
)
import numpy as np
from jutility import plotting
scores_list = [
[69.0, 68.0, 137.0],
[54.1, 68.1, 122.2],
[48.7, 68.1, 116.8],
[28.7, 72.0, 100.7],
[44.7, 54.1, 98.8],
[34.1, 57.0, 91.1],
[33.8, 54.1, 87.9],
[34.2, 45.1, 79.3],
[29.7, 39.1, 68.8],
[54.4, 12.1, 66.5],
[49.2, 12.1, 61.3],
[29.0, 30.1, 59.1],
[24.7, 24.0, 48.7],
[34.3, 12.0, 46.3],
[34.0, 12.0, 46.0],
[19.6, 24.0, 43.6],
[24.0, 12.1, 36.1],
[18.9, 12.0, 30.9],
[9.4, 14.0, 23.4],
[9.4, 7.1, 16.5],
]
scores = np.array(scores_list)
titles = ["Boulder", "Lead", "Total"]
ranges = [102, 102, 202]
mp = plotting.MultiPlot(
*[
plotting.Subplot(
plotting.Hist(scores[:, i], np.arange(r)),
title=t,
)
for i, (t, r) in enumerate(zip(titles, ranges))
],
title="Men's Olympic sport climbing semifinal",
top_space=0.2,
figsize=[15, 4],
num_rows=1,
)
mp.save("combined")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment