Created
October 1, 2022 19:00
-
-
Save lesutton/b545db4ee143aefb8ea9c1a2f40cd427 to your computer and use it in GitHub Desktop.
Donut Plot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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