【发布时间】:2018-08-04 12:02:23
【问题描述】:
有没有办法在时间序列上绘制密度?我正在寻找这样的东西:
【问题讨论】:
-
发布一些数据,并展示您尝试过的内容。 In other words
标签: r plot time-series timeserieschart
有没有办法在时间序列上绘制密度?我正在寻找这样的东西:
【问题讨论】:
标签: r plot time-series timeserieschart
克劳斯·威尔克在ggridges package 的小插曲中有some great examples of exactly this。这是一个可重现的说明它是如何完成的:
library(ggridges)
library(ggplot2movies)
ggplot(movies[movies$year>1912,], aes(x = length, y = year, group = year)) +
geom_density_ridges(scale = 10, size = 0.25, rel_min_height = 0.03) +
theme_ridges() +
scale_x_continuous(limits=c(1, 200), expand = c(0.01, 0)) +
scale_y_reverse(breaks=c(2000, 1980, 1960, 1940, 1920, 1900), expand = c(0.01, 0))
【讨论】: