【问题标题】:What does writing .fig or .figure at the end of a seaborn plot do?在 seaborn 情节的末尾写 .fig 或 .figure 有什么作用?
【发布时间】:2022-01-13 04:05:26
【问题描述】:

我看到有时为了得到想要的情节或者对情节做一些改变,我们需要在绘图函数之后写 .fig 或 .figure 。

例如:

p = sns.relplot(x="total_bill", y="tip", data=data, hue="smoker").fig

.fig 在做什么? .fig 和 .figure 也做同样的事情吗?

【问题讨论】:

    标签: python matplotlib seaborn data-visualization


    【解决方案1】:

    sns.replot 返回一个FaceGrid 对象,该对象提供了用于操作绘图的工具。该对象的figure 属性引用了绘图底层的matplotlib Figure 对象。 fig 属性具有相同的含义,但根据 seaborn documentation 已弃用,应使用 figure 代替。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-21
      • 2011-02-07
      • 1970-01-01
      • 2015-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多