簡體   English   中英

R:在平行坐標圖上獲取軸標簽

[英]R: getting axis labels on parallel coordinates plot

我很難在我的parcoord()圖上獲取標簽。 如果我做 :

library(MASS)
data1<-cbind.data.frame("A"=rbind(6,9,10))
data2<-cbind.data.frame("B"=rbind(3,19,1))
parcoord(cbind(data1,data2), col=1, lty=1)
axis(2, at=c(6,9,10), labels=c("this","should","bealabel"))

我在圖的左側沒有找到標簽。 我該如何解決?

因為y-axis已重新縮放為[0,1] 只需嘗試axis(2)來查看默認軸是什么。 因此,當您at = c(6, 9, 10) ,該范圍超出范圍,因此不會顯示。 這是一個解決方案:

y <- c(6, 9, 10)
pos <- (y - min(y)) / diff(range(y))  ## rescaling
parcoord(cbind(data1,data2), col=1, lty=1)
axis(2, at=pos, labels=c("this","should","bealabel"))

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM