簡體   English   中英

R:格子圖/線框:帶有標簽的圖形問題

[英]R: Lattice Plots/Wireframe : Graphical Issues with labels

我有一個關於線框圖形選項的問題。 我怎樣才能使xlab和ylab與立方體平行-它們在我的圖中看起來很恐怖,請參閱我的其他文章

R中的多面格子圖,例如線框:如何刪除條並添加1-Line字幕

你可以通過列表的zlabxlabylab的參數wireframe 這些列表的一個組成部分可以是rot ,它以度為單位指定軸標簽的旋轉量。 到目前為止,我只能通過反復試驗使標簽與軸“對齊”。

## Code from your other post, to make this reproducible
model_test <- lm(Sepal.Length ~( Petal.Length + Sepal.Width + Petal.Width +Species)^2,
    data=iris)
gg<-expand.grid(Petal.Length=0:6,Species=levels(iris$Species))
vv<-expand.grid(Sepal.Width=0:4,Petal.Width=1:4)

pd<-do.call(rbind,Map(function(Petal.Length,Species,Sepal.Width,Petal.Width){
              nd <- cbind(vv, Petal.Length=Petal.Length,Species=Species,
                               Sepal.Width=Sepal.Width, Petal.Width=Petal.Width)
              cbind(nd, pred=predict(model_test, nd, type="response"))},
              Petal.Length=iris$Petal.Length,Species=iris$Species,
               Sepal.Width=iris$Sepal.Width,Petal.Width=iris$Petal.Width))

## Plot with rotated axis labels
wireframe(pred~Sepal.Width+Petal.Width|Species*Petal.Length,
           pd, drape=FALSE,scale=list(arrows=FALSE),subset=(Species=="setosa"),
           layout = c(3, 3), zlab = list("pred", rot = 90),
           xlab = list("Sepal.Width", rot = 30),
           ylab = list("Petal.Width", rot = -30))

在此處輸入圖片說明

暫無
暫無

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

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