pasztora
10/4/2019 - 7:52 AM

Saving plots in Seaborn

# Saving Seaborn plot as png file
relplot = sns.relplot(data=df2, x="2FL [g/kg]", y="Yield accumulated [%]", hue="Strain", alpha=0.7, palette="tab10")
relplot.savefig(r"u:\Data science\Fig2.png")

# Saving with Matplotlib using tight layout
df_2FL[["Total 2'FL [kg]", "Total DFL [kg]"]].plot.bar(stacked=True).legend(loc='lower left').get_figure().savefig(r"u:\Data science\Factory reports\Fig2019 2FL-DFL total.png", bbox_inches = "tight")