您可以FacetGrid
使用axes
属性访问的各个轴,然后set_xlabel()
在每个轴上使用。例如:
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()
请注意,在此示例中,g.axes
其形状为(1,2)
(一行,两列)。