小编bho*_*sad的帖子

如何在 Seaborn 中创建区域图?

有什么方法可以在 Seaborn 中创建区域图。我查看了文档,但找不到。

这是我想要绘制的数据。

year_countries.head()
Out[19]: 
state_code   China  France  Japan  Russia  United States
launch_year                                             
1957             0       0      0       2              1
1958             0       0      0       5             22
1959             0       0      0       4             18
1960             0       0      0       8             29
1961             0       0      0       9             41
Run Code Online (Sandbox Code Playgroud)

我使用此代码创建了一个线图 -

sns.relplot(data=year_countries, kind='line',
            height=7, aspect=1.3,linestyle='solid')

plt.xlabel('Lanuch Year', fontsize=15)
plt.ylabel('Number of Launches', fontsize=15)
plt.title('Space Launches By Country',fontsize=17)

plt.show()
Run Code Online (Sandbox Code Playgroud)

但是当使用折线图时,情节不是那么清楚 - Plot fig

也无法根据值按降序对图例进行实体化和排序。

谁能帮我这个?

python pandas seaborn

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

pandas ×1

python ×1

seaborn ×1