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", dpi=300)
# Note, savefig comes from matplotlib.pyplot and plt is an
# abbreviation for this, e.g. import matplotlib.pyplot as plt
4.17
6
swarm_plot = sns.swarmplot(...)
fig = swarm_plot.get_figure()
fig.savefig(...)
Thank you!
6
0
3.67
3
sns.distplot(df['mpg'])
plt.savefig('saving-a-high-resolution-seaborn-plot.png', dpi=300)
Thank you!
3
0
Are there any code examples left?
New code examples in category Python