0

I have this problem and i need a help, i need two differents graph (bar and pie) and different df in the same row.

plt.subplot(121)
bar_data.plot(kind="bar", stacked=True, color=['red', 'orange'], rot=50,)
plt.title(JobID)

labels = df2['PQ_Status']
sizes = df2['Job ID']
explode = (0, 0, 0, 0.1)  # only "explode" the 2nd slice (i.e. 'Hogs')

plt.subplot(122)
plt.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=0)
plt.axis('equal')  # Equal aspect ratio ensures that pie is drawn as a circle.

plt.show()

i have this result

enter image description here

But i need this

enter image description here

I try with plt.subplots() but it doesn't work

1 Answers1

0

Using plt.subplots():

fig, axs = plt.subplots( 1, 2 )

df1.plot( ax = axs[ 0 ] )
df2.plot( ax = axs[ 1 ] )
bicarlsen
  • 1,241
  • 10
  • 27