You need to pass a suitably constructed vector of color values to plot() via the parameter "col". Read the section on "Color Specification" for the par() function for details. Also read up on the parameter "pch" for which symbol to use, a filled circle will usually work well. See the help for points() for details. ifelse() will help you construct the vector.
B. On Feb 29, 2016, at 7:22 AM, Partha Sinha <pnsinh...@gmail.com> wrote: > I have the following fields in table: > height, weight, gender > i want to plot height and weight of gender(males and females). The data > points needs to be marked in two different colors. > Regards > parth > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.