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