使用seaborn创建的图需要像普通的matplotlib图一样显示。可以使用
plt.show()
来自matplotlib的功能。
最初,我发布了使用seaborn(
sns.plt.show())中已导入的matplotlib对象的解决方案,但是这被认为是不好的做法。因此,只需直接导入
matplotlib.pyplot 模块并使用
import matplotlib.pyplot as pltplt.show()
如果使用IPython笔记本,则可以调用内联后端以消除在每次绘制后调用show的必要性。各自的魔力是
%matplotlib inline



