Dr. Meesters, Christian
2011-Apr-27 10:49 UTC
[R] lattice wireframe with logarithmically scaled axis?
Hi, I have some questions for the wireframe function of the lattice package. My dataset's "x-data" are sampled logarithmically and as such I would like to have a semilogarithmic 3D plot when plotting a time series. Does anyone know how to change the example in http://addictedtor.free.fr/graphiques/sources/source_40.R such that x or y would be logarithmically scaled? Also, I would like to change the color scale such that it does not scale from min to max, but from min to a value below max. Is this possible? How? TIA, Christian
David Winsemius
2011-Apr-27 14:01 UTC
[R] lattice wireframe with logarithmically scaled axis?
On Apr 27, 2011, at 6:49 AM, Dr. Meesters, Christian wrote:> Hi, > > I have some questions for the wireframe function of the lattice > package. My dataset's "x-data" are sampled logarithmically and as > such I would like to have a semilogarithmic 3D plot when plotting a > time series. Does anyone know how to change the example in > http://addictedtor.free.fr/graphiques/sources/source_40.R > such that x or y would be logarithmically scaled?The scales information in help(wireframe) refers you to the corresponding section of help(xyplot) where an example of changing the scales to logarithmic base 2 on the x axis is presented. A modification to the arguments in your example restricted to the positive-positive quadrant succeeds: > require(lattice) > > x <- seq(0.001, pi, len = 20) > y <- seq(0.001, pi, len = 20) > g <- expand.grid(x = x, y = y) > g$z <- sin(sqrt(g$x^2 + g$y^2)) > print(wireframe(z ~ x * y, g, drape = TRUE, scales=list(x = list(log = 10)), + aspect = c(3,1), colorkey = TRUE))> > Also, I would like to change the color scale such that it does not > scale from min to max, but from min to a value below max. Is this > possible? How?> > TIA, > Christian-- David Winsemius, MD West Hartford, CT
Reasonably Related Threads
- logarithmically scaled y-axis in vioplot
- lattice.wireframe missing wireframe
- lattice: wireframe "eats up" points; how to make points on wireframe visible?
- plot3d, wireframe, persp help
- [lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")