r - 如何创建堆积线图

标签 r charts diagram

在 R 中创建堆积条形图有多种解决方案,但是如何绘制堆积线图?

enter image description here

最佳答案

可以使用 ggplot2 创建堆积线图。包裹。

一些示例数据:

set.seed(11)
df <- data.frame(a = rlnorm(30), b = 1:10, c = rep(LETTERS[1:3], each = 10))

这种绘图的函数是 geom_area :
library(ggplot2)
ggplot(df, aes(x = b, y = a, fill = c)) + geom_area(position = 'stack')

enter image description here

关于r - 如何创建堆积线图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13644529/

相关文章:

r - grid.arrange 使用绘图列表

html - 如何使用动态数据创建 AngularJS 图表

java - PrimeFaces 3.4 图表数据提示格式

java - 如何使图表显示数组元素

configuration - 有没有办法在 draw.io 中使用超链接 - 离线桌面应用程序

r - 更新 R 中的包 : `update.packages` vs. `install.packages`

r - R 中的函数和 try()

architecture - 如何绘制应用架构图

r - 使用多个属性的颜色 shapefile

java - Java 中的 HMI 编辑器