I was wondering if anyone has a way out of the limitation that you must use equal length x,y, and z sequence lengths. For instance, x<-seq(1,100) y<-seq(1,100) z<-rnorm(100) scatterplot3d(z,x,y) works fine. However, if I get some results that has a different y subset length, such as x<-seq(1,100) y<-seq(1,300) z<-rnorm(100) scatterplot3d(z,x,y) I get the following error: Error in xyz.coords(x = x, y = y, z = z, xlab = xlabel, ylab = ylabel, : 'x', 'y' and 'z' lengths differ I have found one solution is to pad the values with n*0, where n is the number of excess variables of y over x and z. Unfortunately, the visual appearance is not that appealing. The situation is very practical as there are cases where you might limit the x axis variable length to some value, and have many more runs of y (monte carlo sweeps for instance). Ideally, rather than pad, If I cannot limit the length of one axis to the same length of another, I would just like the color to be transparent for those values (edges and vertices). thanks, rtist -- View this message in context: http://r.789695.n4.nabble.com/scatterplot-3d-equal-axis-sequence-length-limitation-tp2552476p2552476.html Sent from the R help mailing list archive at Nabble.com.
Duncan Murdoch
2010-Sep-23 19:35 UTC
[R] scatterplot 3d equal axis sequence length limitation
On 23/09/2010 2:10 PM, rtist wrote:> I was wondering if anyone has a way out of the limitation that you must use > equal length > x,y, and z sequence lengths. > For instance, > x<-seq(1,100) > y<-seq(1,100) > z<-rnorm(100) > scatterplot3d(z,x,y) > > works fine. > However, if I get some results that has a different y subset length, such as > x<-seq(1,100) > y<-seq(1,300) > z<-rnorm(100) > scatterplot3d(z,x,y) > > I get the following error: > Error in xyz.coords(x = x, y = y, z = z, xlab = xlabel, ylab = ylabel, : > 'x', 'y' and 'z' lengths differ > > > I have found one solution is to pad the values with n*0, where n is the > number of excess variables > of y over x and z. Unfortunately, the visual appearance is not that > appealing. The situation is very practical as there are cases where you > might limit the x axis variable length to some value, and have many > more runs of y (monte carlo sweeps for instance).I don't understand what you would want to plot: scatterplot3d is for plotting triplets (x,y,z). If you have more y's than x's and z's, how do you form the triplets? Duncan Murdoch> Ideally, rather than pad, If I cannot limit the length of one axis to the > same length of another, I would just like the color to be transparent for > those values (edges and vertices). > > thanks, > rtist >