I want to plot 2 variables in a pie chart in python

R

rachelvsamuel

Guest
I want to plot 2 variables in a single bar chart, so the chart looks like this:

chart

I tried this code but it gave a weird graph:

data1 = df_master['doggo']
data2 = df_master['floofer']

# create a figure with two subplots
fig, (ax1, ax2) = plt.subplots(1, 2)

plt.figure(0)
ax1.pie(data1)

plt.figure(1)
ax2.pie(data2)

plt.show();


second chart

Any idea how to make it work?

Continue reading...
 
Top