matplotlib bring plot to front in plots with twin axis

Solutions on MaxInterview for matplotlib bring plot to front in plots with twin axis by the best coders in the world

showing results for - "matplotlib bring plot to front in plots with twin axis"
Ivan
03 Apr 2020
1import matplotlib.pyplot as plt
2fig, ax1 = plt.subplots()
3ax2 = ax1.twiny()
4ax1.set_zorder(1)  # default zorder is 0 for ax1 and ax2
5ax1.patch.set_visible(False)  # prevents ax1 from hiding ax2
similar questions