Skip to content

lattice: wireframe "eats up" points; how to make points on wireframe visible?

2 messages · Deepayan Sarkar, Marius Hofert

#
On Thu, Mar 31, 2011 at 3:26 AM, Marius Hofert <m_hofert at web.de> wrote:
Yes, that probably needs a new argument; the default computation is a
bit of a hack. You can try the following workaround for now:

wireframe(z~x*y, pts=pts, aspect=1, scales=list(col=1, arrows=FALSE),
          zlim=c(0,1),
          par.settings = list(background = list(col = "#ffffff11")), ## <- NEW
          panel.3d.wireframe = function(x,y,z,xlim,ylim,zlim,xlim.scaled,
                                        ylim.scaled,zlim.scaled,pts,...){
              panel.3dwire(x=x, y=y, z=z, xlim=xlim, ylim=ylim, zlim=zlim,
                           xlim.scaled=xlim.scaled, ylim.scaled=ylim.scaled,
                           zlim.scaled=zlim.scaled, ...)
              panel.3dscatter(x=pts[,1], y=pts[,2], z=pts[,3],
                              xlim=xlim, ylim=ylim, zlim=zlim,
                              xlim.scaled=xlim.scaled, ylim.scaled=ylim.scaled,
                              zlim.scaled=zlim.scaled, type="p", col=c(2,3),
                              cex=1.8, pch=c(3,4), .scale=TRUE, ...)
          })

col = "#ffffff00" instead will give you full transparency (but
"transparent" will not work), and col = "#ffffff77" will be less
transparent and so on.

-Deepayan
1 day later
#
Dear Deepayan,

thank you very much, this works great.

Cheers,

Marius
On 2011-04-01, at 13:58 , Deepayan Sarkar wrote: