Skip to content

Instantly share code, notes, and snippets.

@Adityanagraj
Last active May 29, 2020 15:17
Show Gist options
  • Save Adityanagraj/120e5a34d532d9501965f4b59ce0abf0 to your computer and use it in GitHub Desktop.
Save Adityanagraj/120e5a34d532d9501965f4b59ce0abf0 to your computer and use it in GitHub Desktop.
#importing all necessary requirements
import pandas as pd
import matplotlib.pyplot as plt
from pywaffle import Waffle
 
#creation of a dataframe
data={'phone': ['Xiaomi', 'Samsung', 'Apple','Nokia','Realme'],
 'stock': [44,12,8,5,3]
 }
df=pd.DataFrame(data)
#To plot the waffle Chart
fig = plt.figure(
 FigureClass=Waffle,
 rows=5,
 values=df.stock,
 labels=list(df.phone)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment