matplotlib / 3.4.3 / _as_gen / matplotlib.pyplot.twinx.html /

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

Examples using matplotlib.pyplot.twinx

© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.4.3/api/_as_gen/matplotlib.pyplot.twinx.html