matplotlib.pyplot.twinx

matplotlib.pyplot.twinx(ax=None)

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

See also

examples/api_examples/two_scales.py
For an example

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