plots 2 bar charts with secondary y axis

PHOTO EMBED

Thu Oct 14 2021 08:21:07 GMT+0000 (UTC)

Saved by @CaoimhedeFrein #python

fig = plt.figure(figsize = (20,8)) # Create matplotlib figure

ax = fig.add_subplot(111) # Create matplotlib axes
ax2 = ax.twinx() # Create another axes that shares the same x-axis as ax.

width = 0.4

df_cuba.GP_per_sender.plot(kind='bar', color='m', ax=ax, width=width, position=1)
df_row.GP_per_sender.plot(kind='bar', color='blue', ax=ax2, width=width, position=0)

ax.set_ylabel('cuba', color='m')
ax2.set_ylabel('row', color='b')

plt.show()
content_copyCOPY