You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed that the Priestley timeline at /vis-common-plots.html#priestly-timeline was incomplete. This code or some variation of it should complete it - I can make a pull request.
df = df.sort_values('Born')
# Create the plot
fig, ax = plt.subplots(figsize=(12, 6))
for i, (index, row) in enumerate(df.iterrows()):
lifespan = (row['Died'] - row['Born']).days
bar = ax.barh(len(df) - 1 - i, lifespan, left=row['Born'], height=0.5)
text_x = row['Born'] + pd.Timedelta(days=lifespan/2)
# Add text inside the bar
ax.text(text_x, len(df) - 1 - i, row['Name'],
va='center', ha='center',
color='white', fontweight='bold', fontsize=8)
ax.set_yticks([])
plt.xlabel('Year')
plt.show()
The text was updated successfully, but these errors were encountered:
Noticed that the Priestley timeline at /vis-common-plots.html#priestly-timeline was incomplete. This code or some variation of it should complete it - I can make a pull request.
The text was updated successfully, but these errors were encountered: