You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.0.2.post2287+g4f76f045a
matplotlib
Fork me on GitHub

matplotlib.pyplot.twinx

matplotlib.pyplot.twinx(ax=None)[source]

Make and return a second axes that shares the x-axis. The new axes will overlay ax (or the current axes if ax is None), and its ticks will be on the right.

Examples

Plots with different scales