Dual y axis (second axis) use in ggplot2
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I come to encounter a problem that using two different data with the help of second axis function as described in this previous post how-to-use-facets-with-a-dual-y-axis-ggplot . I am trying to use geom_point and geom_bar but the since the geom_bar data range is different it is not seen on the graph. Here is what I have tried; point_data=data.frame(gr=seq(1,10),point_y=rnorm(10,0.25,0.1)) bar_data=data.frame(gr=seq(1,10),bar_y=rnorm(10,5,1)) library(ggplot2) sec_axis_plot <- ggplot(point_data, aes(y=point_y, x=gr,col="red")) + #Enc vs Wafer