Doing a visual graphic and trying to make it "pretty" Here's simple chart to play with: library(rgl) dotframe<-data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3, type='s',col=c('red','green','blue','purple','orange','gray'), axes=FALSE, box=FALSE, xlab='',ylab='',zlab='') text3d(x=7,y=0,z=0, text="hello, world",adj = 0.5, color="blue") #adds a label at one of the points My questions: 1) is there a way to label the points (spheres in this case) so that the label 'stays on top'? other than text3d(), which adds labels, but they are hidden when the graph is rotated? 2) can a bitmap, say, of a company or university be inserted into the title area? 3) can a bitmap be used as the marker for a point? Thanks in advance for help-I learn a lot from others questions and appreciate direction (even if it's RTFM!) Dale
On Sep 7, 2011, at 6:07 PM, Dale Coons wrote:> Doing a visual graphic and trying to make it "pretty" > > Here's simple chart to play with: > > library(rgl) > dotframe<- > data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) > dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3, > type='s',col=c('red','green','blue','purple','orange','gray'), > axes=FALSE, box=FALSE, xlab='',ylab='',zlab='') > > text3d(x=7,y=0,z=0, text="hello, world",adj = 0.5, color="blue") > #adds a label at one of the points > > My questions: > > 1) is there a way to label the points (spheres in this case) so that > the label 'stays on top'? other than text3d(), which adds labels, > but they are hidden when the graph is rotated? > 2) can a bitmap, say, of a company or university be inserted into > the title area? > 3) can a bitmap be used as the marker for a point? > > Thanks in advance for help-I learn a lot from others questions and > appreciate direction (even if it's RTFM!) >No RTFM (or advice) from me. I'm afraid all I have to offer is the whimsical notion that the next thing people will request is how to program Second Life avatars within R. -- David Winsemius, MD West Hartford, CT
On 11-09-07 6:07 PM, Dale Coons wrote:> Doing a visual graphic and trying to make it "pretty" > > Here's simple chart to play with: > > library(rgl) > dotframe<-data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) > dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3, > type='s',col=c('red','green','blue','purple','orange','gray'), > axes=FALSE, box=FALSE, xlab='',ylab='',zlab='') > > text3d(x=7,y=0,z=0, text="hello, world",adj = 0.5, color="blue") #adds a > label at one of the points > > My questions: > > 1) is there a way to label the points (spheres in this case) so that the > label 'stays on top'? other than text3d(), which adds labels, but they > are hidden when the graph is rotated?Yes, but it's not trivial. You need to write your own mouse handler, that erases the old labels, rotates the data, and replots the labels afterwards. This would be quite feasible with a small number of labels, but maybe not if you have too many: the delays for replotting would be noticeable.> 2) can a bitmap, say, of a company or university be inserted into the > title area?I think so, by plotting a "sprite" with the bitmap as a "texture". See ?sprites3d.> 3) can a bitmap be used as the marker for a point?That also sounds like a sprite. Duncan Murdoch> > Thanks in advance for help-I learn a lot from others questions and > appreciate direction (even if it's RTFM!) > > Dale > > ______________________________________________ > R-help at 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.