[R] axes3d/bbox3d - axis values not fixed

Duncan Murdoch murdoch.duncan at gmail.com
Sat Oct 8 23:36:28 CEST 2011


On 11-10-08 11:04 AM, Ben qant wrote:
> Thank you!
>
> Sorry, I have a couple more questions:
> 1) How to I turn off the box shading completely? I figured out how to
> lighten it up to a grey color with col=c("white"...  . I looked in the
> package pdf, but I didn't see anything.
> 2) I read about the zunit in the package pdf, but no matter what I change it
> to it doesn't seem to change anything.
>
> Here is where I am at right now:
>
> x<- 1:10
> y<- 1:10
> z<- matrix(outer(x-5,y-5) + rnorm(100), 10, 10)
> open3d()
> persp3d(x, y, z, col="red",
> alpha=0.7,aspect=c(1,1,1),xlab='',ylab='',zlab='z', axes=F)
> bbox3d(xat=c(5, 6), xlab=c("a", "b"), yat=c(2,4,6), zunit=10,
> col=c("white","black"))
>

You need to play with the "material properties" of the bounding box.  I 
think this gives what you want:

bbox3d(xat=c(5, 6), xlab=c("a", "b"), yat=c(2,4,6), zunit=10,
   col="black", front="line", back="line", lit=FALSE)

I see different axes for zunit=5, zunit=10, zunit=20.  Not sure why you 
don't.

Duncan

> Thank you for your help!
>
> Ben
>
>
> On Sat, Oct 8, 2011 at 5:09 AM, Duncan Murdoch<murdoch.duncan at gmail.com>wrote:
>
>> On 11-10-07 2:32 PM, Ben qant wrote:
>>> Hello,
>>>
>>> I'm using the rgl package and plotting a plot with it. I'd like to have
>> all
>>> the axes values auto-hide, but I want to plot a series of characters
>> instead
>>> of the values of the measurement for 2 of the axes. So in the end I will
>>> have one axis (z actually) behave per normal (auto-hide) and I'd like the
>>> other two axes to be custom character vectors that auto-hide.
>>
>> The axes in rgl are a little messy.  It's been on my todo list for a long
>> time to fix them, but there are a lot of details to handle, and only so much
>> time.
>>
>> Essentially there are two separate systems for axes:  the "bbox3d" system,
>> and the "axis3d" system.  The former is the ones that appear and disappear,
>> the latter is really just lines and text added to the plot.
>>
>>
>>>
>>> Example:
>>> x<- 1:10
>>> y<- 1:10
>>> z<- matrix(outer(x-5,y-5) + rnorm(100), 10, 10)
>>> open3d()
>>> persp3d(x, y, z, col="red", alpha=0.7,
>>> aspect=c(1,1,0.5),xlab='',**ylab='',zlab='', axes=F)
>>>
>>> For the above, axes=F for demonstration purposes only. Now when I call:
>>> axes3d()
>>> ...the axis values hide/behave the way I want, but I want my own
>> characters
>>> in there instead of the values that default.
>>
>> You want to use the bbox3d() call.  For example,
>>
>> bbox3d(xat=c(5, 10), xlab=c("V", "X"), yat=c(2,4,6), zunit=10)
>>
>> for three different types of labels on the three axes.  It would be nice if
>> axis3d had the same options as bbox3d, but so far it doesn't.
>>
>> Duncan Murdoch
>>
>>
>>>
>>> Trying again:
>>> open3d()
>>> persp3d(x, y, z, col="red", alpha=0.7,
>>> aspect=c(1,1,0.5),xlab='',**ylab='',zlab='', axes=F)
>>> axis3d('x',labels='test')
>>> ...puts in a custom character label 'test', but I loose the
>> behavior/hiding.
>>>
>>>
>>> Also, then how do I get the values for the z axis to populate with the
>>> default values and auto-hide with the other two custom string axes
>>> auto-hiding?
>>>
>>> I'm pretty sure I need to use bbox3d(), but I'm not having any luck.
>>>
>>> I'm new'ish to R and very new to the rgl package. Hopefully that makes
>>> sense.
>>>
>>> Thanks for your help!
>>>
>>> ben
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> ______________________________**________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html<http://www.R-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>



More information about the R-help mailing list