Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python seaborn.barplot是否会在不传递任何参数的情况下接受matplotlib.pyplot变量?_Python_Matplotlib_Seaborn - Fatal编程技术网

Python seaborn.barplot是否会在不传递任何参数的情况下接受matplotlib.pyplot变量?

Python seaborn.barplot是否会在不传递任何参数的情况下接受matplotlib.pyplot变量?,python,matplotlib,seaborn,Python,Matplotlib,Seaborn,我刚开始学习机器学习,最近我一直在研究一种机器学习算法。我看到seaborn.barplot使用plt.figure来显示图形,没有任何参数。这怎么可能 fig=plt.figure(figsize=(7,7)) sns.barplot(x=质量,y=固定酸度,数据=葡萄酒数据) fig没有作为参数传递给sns.barplot,但它根据figsize显示图形。 将numpy导入为np 将matplotlib.pyplot作为plt导入 导入seaborn作为sns 数据=np.随机.正常(0,

我刚开始学习机器学习,最近我一直在研究一种机器学习算法。我看到seaborn.barplot使用plt.figure来显示图形,没有任何参数。这怎么可能

fig=plt.figure(figsize=(7,7))
sns.barplot(x=质量,y=固定酸度,数据=葡萄酒数据)
fig没有作为参数传递给sns.barplot,但它根据figsize显示图形。

将numpy导入为np
将matplotlib.pyplot作为plt导入
导入seaborn作为sns
数据=np.随机.正常(0,1,3)
#数组([-1.18878589,0.59627021,1.59895721])
plt.图(figsize=(16,6))

sns.箱线图(x=数据)在seaborn条形图代码中,您可以找到以下内容:


这意味着,如果用户未提供轴
ax
,则取当前图形中的当前轴。您已使用给定的地物尺寸创建了当前地物。因此,seaborn将其条形图绘制为该图。

感谢您抽出时间回答这个问题。因此,如果sns从其上方的matplotlib.pyplot.figure中找到“figsize”,它将使用该大小来绘制图形。是的,seaborn使用matplotlib.pyplot.figure来调整绘图大小。因此,使用关键字的功能如何工作?matplotlib.pyplot作为plt导入,因此将使用关键字“plt”访问与包相关的所有功能
if ax is None:
    ax = plt.gca()