看板 R_Language 關於我們 聯絡資訊
dt <- data.frame( type=c("A","B"), freq = c(1200,1650), earn = c(0.94,0.98)) bp <- barplot((dt[,2]),yaxt="n",col="lightblue") box() lines(bp, dt[,3]*500, col = 4) X軸放type A&B Y1軸是earn 用trend Y2軸是freq 用直方圖呈現 因 2種資料差異很大 但畫出來的圖不美觀 另外 如何顯示雙Y軸的座標軸 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.138.0.233 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1482202112.A.9BD.html
andrew43: 參考 https://goo.gl/HoRwIP 12/20 18:09