Following the accepted answer here , use subplots to create Figure and axis instances of objects.
import pandas as pd import numpy as np import matplotlib.pyplot as plt
Note that the keyword arguments to sharex , sharey and layout not assigned in df1.hist() , in favor of the settings for sharex , sharey , nrows and ncols in plt.subplots to achieve similar effects. An important element is the assignment of the df.hist() argument to the ax keyword for a previously initialized axes object. The name can be set using suptitle .

Kevin source share