Re: [R] lattice: How to increase space between ticks and labels of z-axis?

2011-03-04 Thread Marius Hofert
Dear Peter,

nice approach! 
Of course it's a bit tedious because you have to specify where the ticks are 
drawn yourself. But it solves the problem. 

Thanks!

Marius

On 2011-03-04, at 01:32 , P Ehlers wrote:

> Marius Hofert wrote:
>> Dear expeRts,
>> How can I increase the space between the ticks and the labels in the 
>> wireframe plot
>> below? I tried some variations with par.settings=list(..) but it just didn't 
>> work.
> 
> Marius,
> 
> I tried setting the 'distance' parameter, but that was less
> than satisfactory. One way is to modify the labels appropriately:
> 
> z_at <- seq(2000,1,2000)
> z_labs <- paste(z_at, "", sep="")
> 
> which tacks on some spaces, and then plot:
> 
> wireframe(z~grid[,1]*grid[,2],
>  aspect=1,
>  scales = list(arrows = FALSE,
>z = list(at = z_at, lab = z_labs)
>  ),
>  zlab = list("z", hjust = 3),
>  ylab = list(rot = -40),
>  xlab = list(rot = 30)
> )
> 
> Peter Ehlers
> 
>> Many thanks,
>> Marius
>> library(lattice)
>> u <- seq(0, 1, length.out=20)
>> grid <- expand.grid(x=u, y=u)
>> z <- apply(grid, 1, function(x) 1/(x[1]*x[2]+0.0001))
>> wireframe(z~grid[,1]*grid[,2], aspect=1, scales=list(col=1, arrows=FALSE))
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lattice: How to increase space between ticks and labels of z-axis?

2011-03-03 Thread P Ehlers

Marius Hofert wrote:

Dear expeRts,

How can I increase the space between the ticks and the labels in the wireframe 
plot
below? I tried some variations with par.settings=list(..) but it just didn't 
work.


Marius,

I tried setting the 'distance' parameter, but that was less
than satisfactory. One way is to modify the labels appropriately:

 z_at <- seq(2000,1,2000)
 z_labs <- paste(z_at, "", sep="")

which tacks on some spaces, and then plot:

 wireframe(z~grid[,1]*grid[,2],
  aspect=1,
  scales = list(arrows = FALSE,
z = list(at = z_at, lab = z_labs)
  ),
  zlab = list("z", hjust = 3),
  ylab = list(rot = -40),
  xlab = list(rot = 30)
)

Peter Ehlers



Many thanks,

Marius



library(lattice)

u <- seq(0, 1, length.out=20)
grid <- expand.grid(x=u, y=u)
z <- apply(grid, 1, function(x) 1/(x[1]*x[2]+0.0001))

wireframe(z~grid[,1]*grid[,2], aspect=1, scales=list(col=1, arrows=FALSE))
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] lattice: How to increase space between ticks and labels of z-axis?

2011-03-03 Thread Marius Hofert
Dear expeRts,

How can I increase the space between the ticks and the labels in the wireframe 
plot
below? I tried some variations with par.settings=list(..) but it just didn't 
work.

Many thanks,

Marius



library(lattice)

u <- seq(0, 1, length.out=20)
grid <- expand.grid(x=u, y=u)
z <- apply(grid, 1, function(x) 1/(x[1]*x[2]+0.0001))

wireframe(z~grid[,1]*grid[,2], aspect=1, scales=list(col=1, arrows=FALSE))
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.