Felix Schönbrodt
2012-Nov-22 09:16 UTC
[R] [lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")
Hello, I try to increase the distance between tick labels and ticks in a lattice wireframe plot. Here's a minimal example: ## Minimal example x <- y <- z <- c(1,2,3) df <- data.frame(x, y, z) wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6)) I tried the axis.components option (http://r.789695.n4.nabble.com/Lattice-distance-of-tick-labels-from-axis-line-tp3693014p3693014.html). This works for xyplot, but *not* for wireframe: xyplot(z ~ x, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6), par.settings=list(axis.components=list(left=list(pad1=2)))) wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6), par.settings=list(axis.components=list(left=list(pad1=2)))) Any ideas on how to pad the axis labels in wireframe plots? Thanks, Felix
Peter Ehlers
2012-Nov-23 02:03 UTC
[R] [lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")
On 2012-11-22 01:16, Felix Sch?nbrodt wrote:> Hello, > > I try to increase the distance between tick labels and ticks in a lattice wireframe plot. Here's a minimal example: > > ## Minimal example > x <- y <- z <- c(1,2,3) > df <- data.frame(x, y, z) > wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6)) > > > I tried the axis.components option (http://r.789695.n4.nabble.com/Lattice-distance-of-tick-labels-from-axis-line-tp3693014p3693014.html). This works for xyplot, but *not* for wireframe: > > xyplot(z ~ x, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6), par.settings=list(axis.components=list(left=list(pad1=2)))) > > wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6), par.settings=list(axis.components=list(left=list(pad1=2)))) > > Any ideas on how to pad the axis labels in wireframe plots? > > Thanks, > FelixI think that you want the 'distance=' argument to scales (which is documented in ?wireframe). Try this: wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck = c(0.8, 0.6, 0.4), distance =c(2, 5, 8))) Adjust as you prefer. Peter Ehlers