每边有 2 个 y 轴和不同比例的 ggplot - ggplot with 2 y axes on each side and different scales

问题:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章