Re: [R] scatterplot3d using colors in groups

From: Duncan Mackay <>
Date: Wed, 04 May 2011 10:37:29 +1000

At 10:15 04/05/2011, you wrote:
>Content-Type: text/plain
>Content-Disposition: inline
>Content-length: 537
>Hi everyone,
>I would like to improve my plot and I was
>wondering if someone can help me whith it. I'm
>trying this plot using two groups, but I want to
>choice the colors (the black and white circles)
>but I don't know how to change it from here. These are my sentences:
>myplot3d<- scatterplot3d(myfile$Temperature,
>acantarcthus$Salinity,myfile$Abundance, type="h",
> color = as.integer(factor(myfile$groups)))
>If someone is willing to help me with it I would be so glad.
> [[alternative HTML version deleted]]
> mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Hi Josť

Have you seen the result of
as.integer(factor(myfile$groups))) ? I would have given you a clue.

What you need is c("black","white") or the numerical col number equivalent by the order of the groups.

2 ways:

ifelse(myfile$groups == factor1, "black","white")

or if you had more factors

sapply(myfile$groups, pmatch, unique(myfile$groups) )


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Email: home mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 05 May 2011 - 06:25:11 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 Thu 05 May 2011 - 07:00:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive