Re: [R] colored 3d scatter plot

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Tue, 04 Mar 2008 22:29:00 -0500

On 04/03/2008 9:54 PM, Jim Lemon wrote:
> SNN wrote:

>> I tried 
>>
>> scatterplot3d(data, color = rep(c("red", "blue"), c(100, 15)), pch=16) and I
>> am getting the following error message,
>>
>>
>> Error in plot.xy(xy.coords(x, y), type = type, ...) : 
>>         invalid color name
>>
>> Does anyone know what he problem is?

> Hi Nancy,
> When you "rep" your colors, the second argument should be a number equal
> to the number of values.

The syntax rep(x, c(100,15)) is legal: it says to repeat the first value 100 times, the second 15 times.

I try the line above and it works with no error. SNN is not telling us something, but I don't know what. Perhaps the content of data is relevant, or the content of his/her workspace, or whatever.

Duncan Murdoch

That is, if "data" contains 100 x, y and z
> components, try:
>
> scatterplot3d(data,color=rep(c("red","blue"),50),pch=16)
>
> My guess is that you are generating NAs or something with your version.
>
> Jim
>
> ______________________________________________
> 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.



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. Received on Wed 05 Mar 2008 - 03:31:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Mar 2008 - 04:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive