[R] question about the axis label

Uwe Ligges ligges at statistik.tu-dortmund.de
Tue Jan 25 09:13:10 CET 2011

Unfortunately, this fine control is only hardly possible:

1. [x,y].ticklabs labels the ticks that are in the plot. If there are 
less ticks than ticklabs, the ticklabs are recycled and hence overlap.

2. xlim should do the trick to restrict to a certain range of values. It 
does not precisely and this is a known unfixed (and hard to fix by 
design) bug.

3. What you can do is enhance the number of ticks by telling R how many 
ticks to use approximately as in:

   scatterplot3d(dat, type = "h",
     lab = c(12, 10,0), lab.z = 8, scale.y = 0.7)

where dat is your data.frame.
This tells R to
  - use approx. 12 ticks on x-axis
  - use approx. 10 ticks on y-axis
  - use approx. 8 ticks on z axis
  - scale y length by factor of 0.7

Best wishes,

On 25.01.2011 08:53, 孟欣 wrote:
> Hello sir:
> I have a question about the axis label of scatterplot3d function.
> The data is in the attachment.
> If I use the command:
> scatterplot3d(x,y,z,type="h")
> I want the plot's x-axis lab to be 1,2,3,...,13, y-axis lab to be
> 1,2,3,...11
> But if I use the command:
> scatterplot3d(x,y,z,type="h",x.ticklabs=1:13,y.ticklabs=1:11)
> The axis labs are overlap, still can't get what I want.
> I'm in difficulty in how to set the axis labels,which need your
> suggestion very much.
> Thanks for your help.
> My best.

More information about the R-help mailing list