[R] Axis Location/Data view in scatterplot3d

Duncan Murdoch murdoch at stats.uwo.ca
Thu Nov 1 00:29:39 CET 2007


On 31/10/2007 5:51 PM, Bret Collier wrote:
> All,
> 
> I constructed a fairly simple plot using the below and scatterplot3d. 
> However, the axis locations in scatterplot3d seem to 'hide' quite a bit 
> of the points in my graphic based on the viewing angle, hence not 
> adhering to Tufte's rules.  I tried to determine if I could rotate the 
> graph and relocate all three axis (origin (0, 0, 0))so they would be at 
> the back left so the plotted points would slope down toward the viewer. 
>   Using 'angle' and 'axis' did not get me any closer.  Does anyone have 
> any suggestions?
> 
> TIA,
> Bret
> 
> for(Days_Nesting in 1:55){
> Breeding_Period<-1:118
> DSR_RGWT= exp(6.6205449-0.0589883*Days_Nesting)/(1+ 
> exp(6.6205449-0.0589883*Days_Nesting))
> DSR_BS<-DSR_RGWT^Breeding_Period
> DSR_Final<-as.data.frame(cbind(Days_Nesting, Breeding_Period, DSR_BS))
> write(c(t(DSR_Final)), "location.txt", append=T, ncolumns=3)
> }
> dsr_data<-read.delim("location.txt", header=F, sep="")
> attach(dsr_data)
> scatterplot3d(V1, V2, V3, grid=F, box=T, pch=20, xlim=c(1, 
> 55),ylim=c(1,118), zlim=c(0, 1))

The plot3d() function in rgl allows manipulation of the viewpoint, and 
fairly flexible specification of the axes.

Duncan Murdoch



More information about the R-help mailing list