You can access the individual axes of the FacetGrid
using the axes
property, and then use set_xlabel()
on each of them. For example:
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="ticks", color_codes=True)
tips = sns.load_dataset("tips")
g = sns.FacetGrid(tips, col="time", hue="smoker")
g = g.map(plt.scatter, "total_bill", "tip", edgecolor="w")
g.axes[0,0].set_xlabel('axes label 1')
g.axes[0,1].set_xlabel('axes label 2')
plt.show()
Note in this example, g.axes
has a shape of (1,2)
(one row, two columns).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…