作者CAPPON (JI3)
看板R_Language
標題[問題] barplot請教
時間Tue Dec 20 10:48:30 2016
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://webptt.com/m.aspx?n=bbs/R_Language/M.1482202112.A.9BD.html