I have a plot with a bar graph and a line graph on two separate axes. I want the bar graph to appear behind the line graph.
fig, ax1 = plt.subplots() # ax1 is line graph, ylabel on the left
ax2 = ax1.twinx() # ax2 is bar graph, ylabel on the right
If I set the axes in this order, the bar graph appears on top. However if I swap them, then the y label positions swap as well. How can I make the bar graph appear behind the line graph, while keeping the positions of the y labels in place?