Skip to content

Instantly share code, notes, and snippets.

@jdavidrcamacho
Created October 29, 2024 11:27
Show Gist options
  • Save jdavidrcamacho/ade427e14bfd5b557e87ad89d8d9ad76 to your computer and use it in GitHub Desktop.
Save jdavidrcamacho/ade427e14bfd5b557e87ad89d8d9ad76 to your computer and use it in GitHub Desktop.
Timeline of ancient civilizations in europe
import matplotlib.pyplot as plt
# Updated timeline data for European civilizations and periods
timelines_europe = {
# Neolithic Cultures
"Neolithic Cultures": {"start": -7000, "end": -2500, "color": "lightgreen"},
"Cardial Culture": {"start": -6000, "end": -5000, "color": "lightblue"},
"Linear Pottery Culture (LBK)": {
"start": -5500,
"end": -4500,
"color": "lightblue",
},
"Impressed Ware Culture": {"start": -4000, "end": -2000, "color": "lightblue"},
# Copper Age
"Copper Age (Chalcolithic)": {"start": -3500, "end": -2200, "color": "salmon"},
"Varna Culture": {"start": -4600, "end": -4200, "color": "salmon"},
"Cucuteni-Trypillia Culture": {"start": -4800, "end": -3000, "color": "salmon"},
# Bronze Age
"Bronze Age": {"start": -3200, "end": -600, "color": "gold"},
"Minoan Civilization": {"start": -2700, "end": -1450, "color": "gold"},
"Mycenaean Civilization": {"start": -1600, "end": -1100, "color": "gold"},
"Etruscan Civilization": {"start": -800, "end": -200, "color": "gold"},
# Iron Age
"Iron Age": {"start": -1200, "end": 0, "color": "orange"},
"Celtic Culture": {"start": -800, "end": 1, "color": "orange"},
# Greek City-States
"Classical Greek Period": {"start": -800, "end": -300, "color": "purple"},
"Athenian Democracy": {"start": -508, "end": -322, "color": "purple"},
"Spartan Society": {"start": -800, "end": -200, "color": "purple"},
# Roman Republic
"Roman Republic": {"start": -509, "end": -27, "color": "red"},
}
# Plotting with the x-axis reversed (chronological order from left to right)
fig, ax = plt.subplots(figsize=(20, 10))
ax.grid(True, which="major", axis="x", linestyle="--", color="gray", alpha=0.7)
ax.set_title("Timeline of Ancient Civilizations in Europe", fontsize=20)
ax.set_xlabel("Year (BCE)", fontsize=20)
ax.set_ylabel("", fontsize=20)
# Plot each civilization/event as a horizontal line
for idx, (name, details) in enumerate(timelines_europe.items()):
ax.hlines(
y=idx,
xmin=details["start"],
xmax=details["end"],
color=details["color"],
linewidth=12,
)
ax.text(
details["end"] + 5, idx, f" {name}", verticalalignment="center", fontsize=15
)
# Create a legend
legend_labels = {
"Neolithic Cultures": "lightgreen",
"Cardial Culture": "lightblue",
"Linear Pottery Culture (LBK)": "lightblue",
"Impressed Ware Culture": "lightblue",
"Varna Culture": "salmon",
"Cucuteni-Trypillia Culture": "salmon",
"Minoan Civilization": "gold",
"Mycenaean Civilization": "gold",
"Etruscan Civilization": "gold",
"Celtic Culture": "orange",
"Greek Period": "purple",
"Roman Period": "red",
}
# Add legend to the plot
handles = [plt.Line2D([0], [0], color=color, lw=12) for color in legend_labels.values()]
labels = list(legend_labels.keys())
ax.legend(
handles,
labels,
loc="upper left",
fontsize=20,
facecolor="whitesmoke",
framealpha=1,
edgecolor="black",
)
ax.set_xticks(range(-7000, 1, 1000))
ax.set_xlim(-7000, 0) # Setting left-to-right chronology
ax.set_yticks([]) # This removes the y-axis tick marks
ax.tick_params(axis="x", labelsize=20) # Set font size for x-axis tick labels
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment