[英]R: Lattice Plots/Wireframe : Graphical Issues with labels
我有一個關於線框圖形選項的問題。 我怎樣才能使xlab和ylab與立方體平行-它們在我的圖中看起來很恐怖,請參閱我的其他文章
你可以通過列表的zlab
, xlab
和ylab
的參數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.