I tried the following code (test_seaborn.py
):
import matplotlib
matplotlib.use(\'Agg\')
import matplotlib.pyplot as plt
matplotlib.style.use(\'g
You should just be able to use the savefig
method of sns_plot
directly.
sns_plot.savefig("output.png")
For clarity with your code if you did want to access the matplotlib figure that sns_plot
resides in then you can get it directly with
fig = sns_plot.fig
In this case there is no get_figure
method as your code assumes.