File:Womens hour records progression.svg
Aus Wikimedia Commons, dem freien Medienarchiv
Zur Navigation springen
Zur Suche springen
![File:Womens hour records progression.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Womens_hour_records_progression.svg/800px-Womens_hour_records_progression.svg.png?20220821214526)
Größe der PNG-Vorschau dieser SVG-Datei: 800 × 465 Pixel. Weitere Auflösungen: 320 × 186 Pixel | 640 × 372 Pixel | 1.024 × 595 Pixel | 1.280 × 743 Pixel | 2.560 × 1.487 Pixel | 1.071 × 622 Pixel.
Originaldatei (SVG-Datei, Basisgröße: 1.071 × 622 Pixel, Dateigröße: 91 KB)
Dateiinformationen
Strukturierte Daten
Bildtexte
Kurzbeschreibungen
Ergänze eine einzeilige Erklärung, was diese Datei darstellt.
Plot showing the progression of the three UCI Hour Records for Women, from 1970 to 2022.
Inhaltsverzeichnis
Beschreibung
[Bearbeiten]BeschreibungWomens hour records progression.svg |
English: The progression of the UCI Hour Record in cycling for Women, broken up into the three currently recognized categories:
|
||
Datum | |||
Quelle | Eigenes Werk | ||
Urheber | Falcorian | ||
SVG‑Erstellung InfoField | ![]() Dieser Plot wurde mit Matplotlib erstellt. | ||
Quelltext InfoField | Python code#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
# In[2]:
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
# In[3]:
# Set plotting style
plt.style.use("seaborn-white")
RECORD_TO_TEXT = {
"uci": "UCI Record",
"best": "Best Human Effort",
"unified": "Unified Record",
}
CURRENT_PALLETE = sns.color_palette()
PLOT_COLORS = {
"uci": CURRENT_PALLETE[0],
RECORD_TO_TEXT["uci"]: CURRENT_PALLETE[0],
"best": CURRENT_PALLETE[1],
RECORD_TO_TEXT["best"]: CURRENT_PALLETE[1],
"unified": CURRENT_PALLETE[2],
RECORD_TO_TEXT["unified"]: CURRENT_PALLETE[2],
}
WIDTH = 12
HEIGHT = 7
get_ipython().run_line_magic('matplotlib', 'inline')
# # Load the data
#
# I have already scraped the HTML, read it into Pandas, and cleaned it up. So I'll just load that cleaned data.
# In[4]:
df = pd.read_json("./hour_record_dataframe.json", orient="table")
# In[5]:
# Rename some riders who have *REALLY* long names
df = df.replace(
{
"Leontien Zijlaard-van Moorsel": "Leontien van Moorsel",
"Molly Shaffer Van Houweling": "Molly Van Houweling",
}
)
# In[6]:
df.head()
# # Plotting
# In[7]:
def draw_bands(ax, ticks=None):
"""Add grey bands to the plot.
Args:
ax: a matplotlib axes object.
ticks: a list of tick postions, to use instead of the ones that come
with ax.
"""
if ticks is None:
ticks = ax.get_xticks(minor=False)
for i in range(0, len(ticks), 2):
# Check for the end of the array
if i >= len(ticks) or i + 1 >= len(ticks):
return
# Draw a band
left_tick = ticks[i]
right_tick = ticks[i + 1]
plt.axvspan(left_tick, right_tick, color="0.97", zorder=-2)
ticks = ax.get_xticks(minor=False)
# In[8]:
def draw_legend(plt):
"""Draw the legend on the specified plot.
Args:
plt (matplotlib.pyplot): pyplot object
"""
leg = plt.legend(
loc="upper left",
fontsize=18,
ncol=1,
frameon=1,
fancybox=True,
# The bellow commands remove the lines in the legend
handlelength=0,
handletextpad=0,
markerscale=0,
)
# Turn on and theme the frame
frame = leg.get_frame()
frame.set_linewidth(1)
frame.set_alpha(1)
frame.set_facecolor("white")
frame.set_edgecolor("black")
# Set the legend text color to match the line color
handles, _ = ax.get_legend_handles_labels()
texts = leg.get_texts()
for _, text in zip(handles, texts):
text.set_color(PLOT_COLORS[text.get_text()])
fig.tight_layout()
# In[9]:
def annotate_point_with_name(row, color, nudges):
rider = row["rider"]
distance = row["distance (km)"]
date = row["date"]
text = f"{rider} ({distance} km) "
# Try to get nudges
adjust = nudges.get((rider, distance), (0, 0))
x_adjust = adjust[0] * 365.0 # Convert to years
x_pos = date + pd.to_timedelta(x_adjust, unit="D")
y_pos = distance + adjust[1]
plt.text(
x_pos,
y_pos,
text,
horizontalalignment="right",
verticalalignment="center",
color=color,
fontsize=16,
fontweight="bold",
)
# In[10]:
def plot_steps_and_markers(df, nudges, ax):
MAX_DATE = max(df["date"])
plt.sca(ax)
for record in df["record"].unique():
color = PLOT_COLORS[record]
df_tmp = df[df["record"] == record]
heights = list(df_tmp["distance (km)"].values)
years = list(df_tmp["date"].values)
# Exend to the end of the plot
heights += [heights[-1]]
years += [MAX_DATE]
plt.step(
x=years,
y=heights,
where="post",
linewidth=2.5,
color=color,
label=RECORD_TO_TEXT[record],
)
plt.plot(years[:-1], heights[:-1], "o", color=color, markersize=10)
for index, row in df_tmp.iterrows():
annotate_point_with_name(row, color, nudges)
# In[11]:
df_men = df[(df["gender"] == "men") & (df["success"] == True)]
fig, ax = plt.subplots(figsize=(WIDTH, HEIGHT))
annotation_nudge = {
("Eddy Merckx", 49.431): (9, 0.25),
("Chris Boardman", 49.441): (4, 0.25),
("Ondřej Sosenka", 49.7): (5, 0.33),
("Tony Rominger", 55.291): (0.2, -0.36),
}
ax.set_ylabel("Distance (km)", fontsize=20)
plt.title("Men's Hour Record Progression", fontsize=30)
plot_steps_and_markers(df_men, annotation_nudge, ax)
ax.tick_params(axis="both", which="major", labelsize=16)
draw_bands(ax)
draw_legend(ax)
_, x_current = ax.get_xlim()
ax.set_xlim("1966-01-01", x_current)
ticks = ax.get_xticks()
fig.patch.set_facecolor("white")
# Save to disk
for ext in ("png", "svg"):
fig.savefig(
"/tmp/mens_hour_records_progression.{ext}".format(ext=ext),
bbox_inches="tight",
transparent=False,
)
# In[12]:
df_women = df[(df["gender"] == "women") & (df["success"] == True)]
fig, ax = plt.subplots(figsize=(WIDTH, HEIGHT))
annotation_nudge = {
("Maria Cressari", 41.471): (10, -0.27),
("Keetie van Oosten", 43.082): (18, -0.25),
("Jeannie Longo-Ciprelli", 44.767): (20.5, -0.25),
("Jeannie Longo-Ciprelli", 45.094): (20.5, -0.25),
("Leontien van Moorsel", 46.065): (19.5, -0.25),
("Jeannie Longo-Ciprelli", 44.933): (0, 0.25),
("Yvonne McGregor", 47.411): (1.5, 0.3),
("Jeannie Longo-Ciprelli", 48.159): (3, 0.3),
("Catherine Marsal", 47.112): (0, -0.15),
("Molly Van Houweling", 46.273): (0, 0.1),
("Evelyn Stevens", 47.98): (0, -0.1),
("Vittoria Bussi", 48.007): (3, 0.35),
("Joscelin Lowden", 48.405): (0.5, 0.35),
}
ax.set_ylabel("Distance (km)", fontsize=20)
plt.title("Women's Hour Record Progression", fontsize=30)
plot_steps_and_markers(df_women, annotation_nudge, ax)
ax.tick_params(axis="both", which="major", labelsize=16)
draw_bands(ax, ticks[1:-1])
draw_legend(ax)
ax.set_ylim(41, 49.5)
fig.patch.set_facecolor("white")
# Save to disk
for ext in ("png", "svg"):
fig.savefig(
"/tmp/womens_hour_records_progression.{ext}".format(ext=ext),
bbox_inches="tight",
transparent=False,
)
Data
|
Lizenz
[Bearbeiten]
Ich, der Urheberrechtsinhaber dieses Werkes, veröffentliche es hiermit unter der folgenden Lizenz: ![]() ![]() ![]() Diese Datei ist unter den Creative Commons-Lizenzen Namensnennung – Weitergabe unter gleichen Bedingungen 4.0 International, 3.0 nicht portiert, 2.5 Allgemein, 2.0 Allgemein und 1.0 Allgemein lizenziert.
Du darfst es unter einer der obigen Lizenzen deiner Wahl verwenden. |
|||
|
Dateiversionen
Klicke auf einen Zeitpunkt, um diese Version zu laden.
Version vom | Vorschaubild | Maße | Benutzer | Kommentar | |
---|---|---|---|---|---|
aktuell | 21:45, 21. Aug. 2022 | ![]() | 1.071 × 622 (91 KB) | Falcorian (Diskussion | Beiträge) | Update to 2022 |
19:14, 24. Okt. 2021 | ![]() | 1.072 × 620 (88 KB) | Falcorian (Diskussion | Beiträge) | Oops, uploaded old version, this is the new, fixed version | |
19:11, 24. Okt. 2021 | ![]() | 1.071 × 620 (105 KB) | Falcorian (Diskussion | Beiträge) | Remove bullet points from legend | |
18:50, 24. Okt. 2021 | ![]() | 1.072 × 620 (89 KB) | Falcorian (Diskussion | Beiträge) | Update for current progress as of 2021-10-24. | |
04:55, 3. Jun. 2019 | ![]() | 1.071 × 620 (105 KB) | Falcorian (Diskussion | Beiträge) | == {{int:filedesc}} == {{Information |description={{en|1=The progression of the UCI Hour Record in cycling for Women, broken up into the three currently recognized categories: {{legend|#1f77b4|UCI Hour Record}} {{legend|#ff7f0e|UCI Best Human Effort}} {{legend|#2ca02c|UCI Unified Record}} Data is from English Wikipedia Hour Record Article. }} |source={{own}} |author=Falcorian |date=2019-06-02 |other fields={{Igen|Matplotlib|+|code= # -*- coding:... |
Du kannst diese Datei nicht überschreiben.
Dateiverwendung
Die folgenden 3 Seiten verwenden diese Datei:
Globale Dateiverwendung
Die nachfolgenden anderen Wikis verwenden diese Datei:
- Verwendung auf de.wikipedia.org
- Verwendung auf en.wikipedia.org
- Verwendung auf fr.wikipedia.org
- Verwendung auf ja.wikipedia.org
Metadaten
Diese Datei enthält weitere Informationen, die in der Regel von der Digitalkamera oder dem verwendeten Scanner stammen. Durch nachträgliche Bearbeitung der Originaldatei können einige Details verändert worden sein.
Breite | 856.73375pt |
---|---|
Höhe | 497.22pt |