Skip to content

Instantly share code, notes, and snippets.

View satyabansahoo2000's full-sized avatar
🧑‍💻
Coding....

Satyaban Sahoo satyabansahoo2000

🧑‍💻
Coding....
  • WhiteHat Jr.
  • Bengaluru, India
View GitHub Profile
@satyabansahoo2000
satyabansahoo2000 / annotate.py
Created November 30, 2020 09:01
Annotating in Plots
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("white")
plt.figure(figsize=(10,5))
g = sns.countplot(x="", y="", data=df)
for p in g.patches:
g.annotate(format(p.get_height(), '.2f'), (p.get_width()/2., p.get_height()),
ha='center', va='center', xytext=(0,9), textcoords = 'offset points',
fontsize=8, horizontalalignment='right')