You can replace the data in this file with your own data and run it.
import matplotlib.pyplot as plt
import networkx as nx
import textwrap
from google.colab import files # Import files module for download
# Function to wrap text labels for better readability
def wrap_labels(labels, width=12):
return {k: "\n".join(textwrap.wrap(v, width)) for k, v in labels.items()}
# Define the ownership timeline of the artwork
ownerships = [
("Egon Schiele", "Dr. Hermann Engel"),
("Dr. Hermann Engel", "Richard Lanyi"),
("Richard Lanyi", "Hans Zernatto"),
("Hans Zernatto", "LB (Hans Zernatto's daughter)"),
("LB (Hans Zernatto's daughter)", "Rudolf Leopold"),
("Rudolf Leopold", "Leopold Museum")
]
# Define Richard Lanyi's persecution itinerary
lanyi_itinerary = [
("Richard Lanyi", "Nazi Targeting (1938)"),
("Nazi Targeting (1938)", "Bookstore Shut Down (1938)"),
("Bookstore Shut Down (1938)", "Johannes Katzler Takes Over (1938)"),
("Johannes Katzler Takes Over (1938)", "Financial Constraints (1938-1942)"),
("Financial Constraints (1938-1942)", "Gestapo Arrest (1942)"),
("Gestapo Arrest (1942)", "Deportation to Auschwitz (1942)"),
("Deportation to Auschwitz (1942)", "Murdered in Auschwitz (1942)")
]
# Define timeline years
timeline_years = [1910, 1920, 1930, 1940, 1950, 1960]
# Positioning nodes: Artwork ownership above, Lanyi's path below
owner_positions = {
"Egon Schiele": (1910, 2),
"Dr. Hermann Engel": (1920, 2),
"Richard Lanyi": (1930, 2),
"Hans Zernatto": (1940, 2),
"LB (Hans Zernatto's daughter)": (1950, 2),
"Rudolf Leopold": (1960, 2),
"Leopold Museum": (1970, 2)
}
# Adjusted Y positions for better readability and spacing of Lanyi's path
improved_lanyi_positions = {
"Nazi Targeting (1938)": (1938, -1),
"Bookstore Shut Down (1938)": (1938.5, -2),
"Johannes Katzler Takes Over (1938)": (1939, -3.2),
"Financial Constraints (1938-1942)": (1940, -4.5),
"Gestapo Arrest (1942)": (1942, -6),
"Deportation to Auschwitz (1942)": (1942.5, -7.5),
"Murdered in Auschwitz (1942)": (1943, -9)
}
# Merge both positions
positions = {**owner_positions, **improved_lanyi_positions}
# Wrap labels for better readability
wrapped_owner_labels = wrap_labels({node: node for node in owner_positions.keys()}, width=12)
wrapped_lanyi_labels = wrap_labels({node: node for node in improved_lanyi_positions.keys()}, width=20)
# Create graph
G = nx.DiGraph()
G.add_edges_from(ownerships, color="gray")
G.add_edges_from(lanyi_itinerary, color="darkred")
# Define edge colors
edge_colors = [G[u][v]['color'] for u, v in G.edges()]
# Create figure
plt.figure(figsize=(12, 12))
# Draw ownership path above the timeline
nx.draw_networkx_nodes(G, positions, nodelist=owner_positions.keys(), node_color="steelblue", node_size=3500, edgecolors="black")
nx.draw_networkx_edges(G, positions, edgelist=ownerships, edge_color="gray", arrows=True, width=2)
nx.draw_networkx_labels(G, positions, labels=wrapped_owner_labels, font_size=10, font_weight="bold", font_family="serif", font_color="white") # White text for better contrast
# Draw Lanyi's persecution path below the timeline with stronger visual impact
nx.draw_networkx_edges(G, positions, edgelist=lanyi_itinerary, edge_color="darkred", arrows=True, width=2.5, style="dashed")
# Display Lanyi’s persecution labels with bold emphasis
for node, (x, y) in improved_lanyi_positions.items():
plt.text(x, y, wrapped_lanyi_labels[node], fontsize=10, ha="center", fontweight="bold", color="darkred", fontfamily="serif")
# Draw the enhanced timeline with stronger markers
for year in timeline_years:
plt.scatter(year, 0, color="black", s=120) # Larger timeline markers
plt.text(year, 0.4, str(year), fontsize=11, ha="center", fontweight="bold", fontfamily="serif")
# Add dashed timeline line
plt.axhline(0, color="black", linestyle="dashed", linewidth=1.5)
# Title and annotations
plt.title("Itinerary of Egon Schiele's 'Offenbarung' (Above) and Richard Lanyi's Persecution (Below)",
fontsize=14, fontweight="bold", fontfamily="serif")
# Subtitle for context
plt.text(1925, 3, "Tracing the Fate of an Artwork and Its Jewish Collector", fontsize=12, fontweight="bold", color="black", fontfamily="serif")
# Final annotation to emphasize injustice
plt.text(1943, -10, "Richard Lanyi was murdered in Auschwitz in 1942.\nHis collection was lost to history.",
fontsize=11, fontweight="bold", color="darkred", fontfamily="serif", ha="center")
# Adjust display settings
plt.ylim(-10.5, 3.5) # Ensure spacing between sections
plt.xlim(1905, 1975)
plt.xticks([]) # Hide automatic ticks
# Save the figure to a file
filename = "Schiele_Offenbarung_Lanyi_Itinerary.png"
plt.savefig(filename, dpi=300, bbox_inches="tight")
# Show the plot
plt.show()
# Provide a download link for Google Colab users
files.download(filename)