2

在下面的 3D 图中,我希望我的 'percentile' 轴和 'phi' 轴从 0 缩放到 1 而不是 0 到 10。如果有人可以帮助我,我将不胜感激:

x1<-c(13,27,41,55,69,83,97,111,125,139)
x2<-c(27,55,83,111,139,166,194,222,250,278)
x3<-c(41,83,125,166,208,250,292,333,375,417)
x4<-c(55,111,166,222,278,333,389,445,500,556)
x5<-c(69,139,208,278,347,417,487,556,626,695)
x6<-c(83,166,250,333,417,500,584,667,751,834)
x7<-c(97,194,292,389,487,584,681,779,876,974)
x8<-c(111,222,333,445,556,667,779,890,1001,1113)
x9<-c(125,250,375,500,626,751,876,1001,1127,1252)
x10<-c(139,278,417,556,695,834,974,1113,1252,1391)

df<-data.frame(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10)
df.matrix<-as.matrix(df)

library(lattice)

wireframe(df.matrix,
  aspect = c(61/87, 0.4),scales=list(arrows=FALSE,cex=.5,tick.number="10",z=list(arrows=T)),ylim=c(1:10),xlab=expression(phi1),ylab="Percentile",zlab=" Loss",main="Random Classifier",
  light.source = c(10,10,10),drape=T,col.regions = rainbow(100, s = 1, v = 1, start = 0, end = max(1,100 - 1)/100, alpha = 1),screen=list(z=-60,x=-60))
4

1 回答 1

3

我试过这个(在这篇文章之后):

x <- data.frame(z = as.vector(df.matrix))
x$x <- rep(seq(0, 1, length.out = 10), 10)
x$y <- rep(seq(0, 1, length.out = 10), 10)

wireframe(z ~ x * y, x,
          aspect = c(61/87, 0.4),
          scales = list(arrows=FALSE,cex=.5,tick.number = 10, z = list(arrows=T)),
          # ylim = 1:10, 
          xlab=expression(phi1),
          ylab="Percentile",zlab=" Loss",main="Random Classifier",
          light.source = c(10,10,10), drape=T,
          col.regions = rainbow(100, s = 1, v = 1, start = 0, end = max(1,100 - 1)/100, alpha = 1),
          screen=list(z=-60,x=-60))

在此处输入图像描述

于 2013-06-08T07:24:50.030 回答