我在R自我教學中遇到了一些問題。我希望這裏有人能提供幫助,因爲我在Google上找不到解決方案。R中的顏色強度錯誤
我試圖將一些基本的顏色參數應用到plot
命令。我的基本代碼看起來會是:
plot(dose,drugA, type = "b", lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col.axis = rgb(11,114,86), col.lab = rgb(95,195,168), fg = rgb(222,92,53), bg = rgb(222,216,53))
或者:
par(lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col.axis = rgb(11,114,86), col.lab = rgb(95,195,168), fg = rgb(222,92,53), bg = rgb(222,216,53))
每次我用這個代碼,我收到以下錯誤信息:
在RGB錯誤(43,228,178):顏色強度43,不在[0,1]中
任何幫助將不勝感激。
你說的對,但'rgb'也有'maxColorValue ='參數 - 所以你可以做'rgb(43,228,178,maxColorValue = 255) ' – thelatemail