1

For reg plot, this is working:

sns_reg_plot = sns.regplot(x="X", y="y", data=df)
sns_reg_fig = sns_reg_plot.get_figure()
sns_reg_fig.savefig(path)

But for lm plot I get an error:

sns_lm_plot = sns.lmplot(x="X", y="y", hue="hue", data=df)
..
    sns_lm_fig = sns_lm_plot.get_figure()
AttributeError: 'FacetGrid' object has no attribute 'get_figure'
Cranjis
  • 1,590
  • 8
  • 31
  • 64

1 Answers1

1

Just remove the .get_figure line

    sns_im_plot = sns.lmplot(x="X", y="y",hue="hue" data=df)
    sns_im_plot.savefig(path)
Sreekiran A R
  • 3,123
  • 2
  • 20
  • 41