问题:
I need to plot a bar chart showing counts and a line chart showing rate all in one chart, I can do both of them separately, but when I put them together, I scale of the first layer (ie the geom_bar
) is overlapped by the second layer (ie the geom_line
).我需要在一个图表中绘制一个显示计数的条形图和一个显示速率的折线图,我可以分别做这两个,但是当我把它们放在一起时,我的第一层(即geom_bar
)的geom_bar
被重叠第二层(即geom_line
)。
Can I move the axis of the geom_line
to the right?我可以将geom_line
的轴向右移动吗?
解决方案:
参考一: https://stackoom.com/question/D0FP参考二: ggplot with 2 y axes on each side and different scales