📌  相关文章
📜  'FacetGrid' 对象没有属性 'set_title' - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:47.699000             🧑  作者: Mango

代码示例2
# Add a column of appropriate labels
df_reduced['measure'] = df_reduced['ActualExternal'].replace({0: 'Internal',
                                                              1: 'External'}

g = sns.FacetGrid(df_reduced, col="measure", margin_titles=True)
g.map(plt.hist, "ActualDepth", color="steelblue", bins=bins, width=4.5)

# Adjust title and axis labels directly
g.set_titles("{col_name}")  # use this argument literally
g.set_axis_labels(x_var="Percentage Depth", y_var="Number of Defects")