Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.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 3.x Seaborn不';t在DISPLAOT中绘制所有列_Python 3.x_Plot_Markdown_Seaborn - Fatal编程技术网

Python 3.x Seaborn不';t在DISPLAOT中绘制所有列

Python 3.x Seaborn不';t在DISPLAOT中绘制所有列,python-3.x,plot,markdown,seaborn,Python 3.x,Plot,Markdown,Seaborn,我试着用seaborn的代码画Dispot: import pandas as pd import seaborn as sns trips = pd.read_csv('tripdata_2019-05.csv') sns.displot(trips, x='week_day') 结果得到这个图: 但如果我将plot保存到文件中,并以这种方式在标记上查看它: sns.displot(trips, x='week_day') plt.savefig("graphics/week

我试着用seaborn的代码画Dispot:

import pandas as pd
import seaborn as sns

trips = pd.read_csv('tripdata_2019-05.csv')

sns.displot(trips, x='week_day')
结果得到这个图:

但如果我将plot保存到文件中,并以这种方式在标记上查看它:

sns.displot(trips, x='week_day')
plt.savefig("graphics/week_day")
plt.close()
标记单元格:

![](graphics/week_day)
我得到了正确的图:


那么问题出在哪里呢?

这看起来像是图像的锯齿问题。我不知道为什么这些条这么薄,它们在我的电脑上不是那样的

也许可以尝试增加FacetGrid图形的大小

sns.displot(trips, x='week_day', height=6)
您还可以通过添加

plt.rcParams['figure.dpi'] = 300

就在
sns.displaot()

之前,是否可以明确设置边缘颜色?通常matplotlib使用抗锯齿绘制直线,但不使用矩形。