网格线没有显示在我的地图中

2024-05-17 10:12:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用seaborn绘制分布图,但没有得到图中的网格线,这很简单。在

import seaborn as sns
%matplotlib inline

sns.distplot(df_0['temp'], bins=20)

Below is the image for reference

  [1]: https://i.stack.imgur.com/q7z4W.png

Tags: importdfmatplotlibas分布图绘制inlineseaborn
1条回答
网友
1楼 · 发布于 2024-05-17 10:12:14

sns.distplot(df_0['temp'], bins=20).grid()

在seaborn.distplot公司返回底层Matplotlib axes对象,以便进一步操作它。例如:

ax = sns.distplot(df_0['temp'], bins=20)
ax.grid()
ax.axvline(10)

此外,如seaborn文档中所示,您可以通过设置seaborn样式来获得网格线以及其他无菌方法:

^{pr2}$

相关问题 更多 >