Wednesday, May 7, 2025

Python code to use

 import matplotlib.pyplot as plt

import pandas as pd


# Data for the comparison

data = {

    "Aspect": [

        "Role in Revolution",

        "Revolution Strategy",

        "View on Marxism",

        "Economic Policy",

        "View on Provisional Gov’t",

        "Global Revolution",

        "Use of Force",

        "Legacy"

    ],

    "Lenin": [

        "Leader of Bolsheviks; led October Revolution",

        "Immediate socialist revolution via vanguard party",

        "Adapted Marxism to Russian conditions",

        "War Communism, then NEP",

        "Must be overthrown; no compromise",

        "Hoped for it but prioritized Russian success",

        "Justified violence for revolutionary goals",

        "Founder of Soviet state"

    ],

    "Trotsky": [

        "Key military leader; organized Red Army",

        "Permanent Revolution; spread socialism globally",

        "Orthodox Marxist with internationalist emphasis",

        "Supported NEP temporarily, critical of concessions",

        "Agreed; advocated for workers’ soviets",

        "Essential; revolution must spread",

        "Organized Red Army; justified violence if necessary",

        "Brilliant but exiled and later assassinated"

    ],

    "Stalin": [

        "Less prominent in 1917, later rose to power",

        "Gradual consolidation; Socialism in One Country",

        "Pragmatic and authoritarian interpretation of Marxism",

        "Rejected NEP; Five-Year Plans and collectivization",

        "Agreed initially; later used power for own agenda",

        "Opposed; prioritized building socialism in USSR",

        "Extensive purges and terror to maintain control",

        "Dictator who transformed USSR into a superpower"

    ]

}


# Convert to DataFrame

df = pd.DataFrame(data)


# Plotting the table

fig, ax = plt.subplots(figsize=(14, 6))

ax.axis('off')

table = ax.table(cellText=df.values, colLabels=df.columns, cellLoc='left', loc='center')

table.auto_set_font_size(False)

table.set_fontsize(9)

table.scale(1.2, 1.5)


plt.title("Comparison of Lenin, Trotsky, and Stalin on Key Aspects of the Russian Revolution", fontsize=12, weight='bold', pad=20)

plt.tight_layout()

plt.show()


No comments:

Post a Comment