waffle chart done

pull/354/head
Jasleen Sondhi 3 years ago committed by GitHub
parent 496f621999
commit e8e0b3f07e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,25 +150,12 @@ View(cap_color)
Create a waffle chart by creating labels and then grouping your data: Create a waffle chart by creating labels and then grouping your data:
```python ```r
import pandas as pd library(waffle)
import matplotlib.pyplot as plt names(cap_color$count) = paste0(cap_color$cap.color)
from pywaffle import Waffle waffle((cap_color$count/10), rows = 7, title = "Waffle Chart")+scale_fill_manual(values=c("brown", "#F0DC82", "#D2691E", "green",
"pink", "purple", "red", "grey",
data ={'color': ['brown', 'buff', 'cinnamon', 'green', 'pink', 'purple', 'red', 'white', 'yellow'], "yellow","white"))
'amount': capcolor['class']
}
df = pd.DataFrame(data)
fig = plt.figure(
FigureClass = Waffle,
rows = 100,
values = df.amount,
labels = list(df.color),
figsize = (30,30),
colors=["brown", "tan", "maroon", "green", "pink", "purple", "red", "whitesmoke", "yellow"],
)
``` ```
Using a waffle chart, you can plainly see the proportions of cap colors of this mushrooms dataset. Interestingly, there are many green-capped mushrooms! Using a waffle chart, you can plainly see the proportions of cap colors of this mushrooms dataset. Interestingly, there are many green-capped mushrooms!

Loading…
Cancel
Save