【发布时间】:2016-07-01 07:54:41
【问题描述】:
我开始学习一点 Python(一直在使用 R)进行数据分析。我正在尝试使用seaborn 创建两个图,但它一直将第二个保存在第一个之上。如何阻止这种行为?
import seaborn as sns
iris = sns.load_dataset('iris')
length_plot = sns.barplot(x='sepal_length', y='species', data=iris).get_figure()
length_plot.savefig('ex1.pdf')
width_plot = sns.barplot(x='sepal_width', y='species', data=iris).get_figure()
width_plot.savefig('ex2.pdf')
【问题讨论】: