I am trying to plot two separate quantities on the same graph using twiny as follows:
fig = figure() ax = fig.add_subplot(111) ax.plot(T, r, \'b-\', T, R, \'
I was having an issue with the x-label overlapping a subplot title; this worked for me:
import matplotlib.pyplot as plt fig, ax = plt.subplots(2, 1) ax[0].scatter(...) ax[1].scatter(...) plt.tight_layout() . . . plt.show()
reference: