如何使用两个DataFrames制作分组和堆叠的线图?
我有两个数据集,一个是男性,一个用于女性。他们都有4个变量,其中是:DK,SE NO。因此,他们俩看起来都像这样(当然只有不同的值):
我想制作线路男性和女性被堆叠并分组为DK SE,没有。因此,它可以像这样堆叠曲目:
I have two data sets, one is for males and one for females. They both have 4 variables, which are: Year, DK, SE NO. So they both looks like this (of course just with different values):
I want to make line plots for Males and Females stacked and grouped into contries, DK SE and NO. So it can be stacked plots, like this:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尚未告诉我们您的数据框架是什么,但让我们称它们为
MEN
和女性
。只要它们都完全具有相同的列(包括名称),您就可以做:由
强>编造与问题数据相同结构的数据
You haven't told us what your data frames are called, but let's call them
men
andwomen
. As long as they both have exactly the same columns (including names), you can do:Created on 2022-04-22 by the reprex package (v2.0.1)
Made up data with same structure as question data