Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/283.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 Dispot-在一个图形中绘制多个绘图_Python_Matplotlib_Seaborn - Fatal编程技术网

Python Seaborn Dispot-在一个图形中绘制多个绘图

Python Seaborn Dispot-在一个图形中绘制多个绘图,python,matplotlib,seaborn,Python,Matplotlib,Seaborn,这是我的数据帧: age income memberdays 0 55 112000.0 1263 1 75 100000.0 1330 2 68 70000.0 978 3 65 53000.0 1054 4 58 51000.0 1144 ... ... ... 14820 45 5

这是我的数据帧:

       age    income  memberdays
0       55  112000.0        1263
1       75  100000.0        1330
2       68   70000.0         978
3       65   53000.0        1054
4       58   51000.0        1144
   ...       ...         ...
14820   45   54000.0         939
14821   61   72000.0         900
14822   49   73000.0        1433
14823   83   50000.0        1758
14824   62   82000.0        1256
我想在一个图形中创建3个绘图,如下所示:

fig, ax =plt.subplots(1,3)
sns.countplot(profile["age"], ax=ax[0])
sns.countplot(profile["income"], ax=ax[1])
sns.countplot(profile["memberdays"], ax=ax[2])
fig.show()
这是可行的,但我想用
displat
函数绘制分布图

fig, ax =plt.subplots(1,3)
sns.displot(profile["age"], ax=ax[0])
sns.displot(profile["income"], ax=ax[1])
sns.displot(profile["memberdays"], ax=ax[2])
fig.show()
这将导致一个空网格和三个独立的绘图。这是预期的行为吗?如果是,为什么会发生这种情况?我如何克服它


Seaborn:0.11.0

displat
不接受
ax=
参数,请尝试使用
histplot
,如下所示:

fig, ax =plt.subplots(1,3,figsize=(20,10))
sns.histplot(profile["age"], ax=ax[0])
sns.histplot(profile["income"], ax=ax[1])
sns.histplot(profile["memberdays"], ax=ax[2])
fig.show()
它给出以下输出:

displaot
是图形级函数,不接受
ax=
参数。相反,您可以使用轴级功能,如
kdeplot
histplot
。见