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

matplotlib.pyplot.twiny

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

Make a second axes that shares the y-axis. The new axis will overlay ax (or the current axes if ax is None). The ticks for ax2 will be placed on the top, and the ax2 instance is returned.