Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Last active December 6, 2020 13:15
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 amankharwal/d5da261ccdc52b95d7a9e0e510d2da44 to your computer and use it in GitHub Desktop.
Save amankharwal/d5da261ccdc52b95d7a9e0e510d2da44 to your computer and use it in GitHub Desktop.
from matplotlib.gridspec import GridSpec
targetCounts = resumeDataSet['Category'].value_counts()
targetLabels = resumeDataSet['Category'].unique()
# Make square figures and axes
plt.figure(1, figsize=(25,25))
the_grid = GridSpec(2, 2)
cmap = plt.get_cmap('coolwarm')
colors = [cmap(i) for i in np.linspace(0, 1, 3)]
plt.subplot(the_grid[0, 1], aspect=1, title='CATEGORY DISTRIBUTION')
source_pie = plt.pie(targetCounts, labels=targetLabels, autopct='%1.1f%%', shadow=True, colors=colors)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment