Firegem
0
Q:

python how to save a Seaborn plot into a file

# Basic syntax:
plt.savefig("output.png")

# Example usage:
plt.figure()
plt.plot(range(5))
plt.savefig("output.png")

# Note, savefig comes from matplotlib.pyplot and plt is an 
# 	abbreviation for this, e.g. import matplotlib.pyplot as plt
1
sns.distplot(df['mpg'])
plt.savefig('saving-a-high-resolution-seaborn-plot.png', dpi=300)
0
swarm_plot = sns.swarmplot(...)
fig = swarm_plot.get_figure()
fig.savefig(...) 
0

New to Communities?

Join the community