Skip to content

Instantly share code, notes, and snippets.

@lesutton
Created October 1, 2022 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesutton/b545db4ee143aefb8ea9c1a2f40cd427 to your computer and use it in GitHub Desktop.
Save lesutton/b545db4ee143aefb8ea9c1a2f40cd427 to your computer and use it in GitHub Desktop.
Donut Plot
import seaborn as sns
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import warnings
import numpy as np
tips=sns.load_dataset('tips')
tips.day.value_counts()
days = np.array([tips.day])
plt.pie(tips.day.value_counts(), autopct='%.2f%%',radius=1.2,labels=[1,2,3,4],explode=[0,0,0,.5])
circle = plt.Circle((0,0), 0.5, color='white')
plot = plt.gcf()
plot.gca().add_artist(circle)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment