在ggplot

时间:2016-07-23 00:06:00

标签: r plot ggplot2

我一直在谷歌搜索一段时间并没有简单的方法来使用ggplot做双轴?看起来奇怪,因为它是一个强大的包但不能做双轴?

我的问题很基本。我想在两个相同的图上绘制两个数据集。

d1 = data.frame(x = rnorm(15),y = rnorm(15))
d2 = data.frame(x = rnorm(15),y = rnorm(15))
ggplot(data = d1, aes(x= x,y =y))+geom_line()
ggplot(data = d2, aes(x= x,y =y))+geom_line()

我不想使用facet_wrap或facet_grid或将图表彼此对齐。

思考?来自ggplot人的帮助?

谢谢。

1 个答案:

答案 0 :(得分:1)

我在Github软件包plotflow中添加了一个函数,我认为可以做到这一点。如果您不想安装软件包,请使用source code

aws rds

enter image description here

相关问题