Python 目录(sns)未列出plt
我试图使用'dir(sns.plt),但这会导致错误:Python 目录(sns)未列出plt,python,seaborn,Python,Seaborn,我试图使用'dir(sns.plt),但这会导致错误: dir(sns.plt) Traceback (most recent call last): File "<ipython-input-3-8072046646b0>", line 1, in <module> dir(sns.plt) AttributeError: module 'seaborn' has no attribute 'plt' dir(sns.plt) 回溯(最近一次呼叫最后一
dir(sns.plt)
Traceback (most recent call last):
File "<ipython-input-3-8072046646b0>", line 1, in <module>
dir(sns.plt)
AttributeError: module 'seaborn' has no attribute 'plt'
dir(sns.plt)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
处长(社会福利署)
AttributeError:模块“seaborn”没有属性“plt”
如何让“plt”显示或添加它?有关seaborn使用的plt的更多信息,请查看此帖子:
plt
是导入pyplot的常用别名,即import matplotlib.pyplot as plt
。谢谢!这起作用了。在导入matplotlib.pyplot作为plt之后,我还添加了“pyplot作为plt”。