Skip to content

Instantly share code, notes, and snippets.

@minhkstn
Created December 31, 2022 19:02
Show Gist options
  • Save minhkstn/915292fcec64eced3d87f9706264c01a to your computer and use it in GitHub Desktop.
Save minhkstn/915292fcec64eced3d87f9706264c01a to your computer and use it in GitHub Desktop.
import pandas as pd
import matplotlib.pyplot as plt
# get input data
df = pd.read_csv('./gdp_capita.csv')
ax = df.plot.bar(x='Year', width=0.8)
ax.set_ylabel('GDP/capita (USD)')
for container in ax.containers:
ax.bar_label(container)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment