問題:
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