为多箱图定义X轴值

时间:2015-02-12 19:35:04

标签: r

您好我正在尝试将我的X轴值标记为" TDN"," DIN"," PN"," TDP" " SRP"" PP"" PN"" PN.PP"" TDN.TDP"而不是由R完成的1到8,我不知道如何定义它。任何帮助将不胜感激! 这就是我创造的:

par(mfrow= c (1,8), mar = c(5,4,2,1))
boxplot(WQ.flow$TDN, WQ.flow$DIN, WQ.flow$PN, WQ.flow$TDP, WQ.flow$SRP, 
WQ.flow$PP, WQ.flow$PN.PP, WQ.flow$TDN.TDP)

1 个答案:

答案 0 :(得分:0)

只需指定names参数,如下所示:

boxplot(WQ.flow$TDN, 
        WQ.flow$DIN,
        WQ.flow$PN,
        WQ.flow$TDP,
        WQ.flow$SRP,
        WQ.flow$PP,
        WQ.flow$PN.PP,
        WQ.flow$TDN.TDP,
        names = c("TDN", "DIN", "PN","TDP","SRP","PP","PN","PN.PP","TDN.TDP"))