是否可以使用类似于geom_col()的ggridges包来绘制条形图,而不是山脊线
我有如下数据:
dt = tibble(
hr = c(1,2,3,4,1,2,3,4),
fr = c(.1,.5,.9,.1,.4,.9,.9,.4),
gr = c('Mon','Mon','Mon','Mon','Sun','Sun','Sun','Sun')
)下面的图给了我:
ggplot(dt, aes(x=hr, y=gr, height=fr)) +
geom_ridgeline() + ylab(NULL)

正如您所看到的,它绘制了一条连接值的线。我要寻找的是单独的列,如下图所示:
ggplot(dt, aes(x=hr, y=fr)) +
geom_col() + ylab(NULL) +
facet_wrap(~gr)

https://stackoverflow.com/questions/47595095
复制相似问题