Katharina May
2009-Jun-24 19:28 UTC
[R] distinguish regression lines in grouped, black and white lattice xyplot
Hi, I've got the following problem which I cannot think of a solution right now: if got a lattice xyplot in black and white and a grouping variable with many (more than 8 values) and I plot it as regression lines (type="r"), just like this one (not reproducable but that's I guess not the point here): xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species, type="r", lty=c(1:6),panel=allo.panel.5) The problem is that I've got 26 different values for the grouping variable species and only 6 default values for the line type lty (and according to the par {graphics} help page customizable to up to 8 different line types). Does anybody have any idea how these 26 different lines can be made distinguishable from each other without the use of colors? Thanks, Katharina
Chuck Cleland
2009-Jun-24 19:41 UTC
[R] distinguish regression lines in grouped, black and white lattice xyplot
On 6/24/2009 3:28 PM, Katharina May wrote:> Hi, > > I've got the following problem which I cannot think of a solution right now: > > if got a lattice xyplot in black and white and a grouping variable > with many (more than 8 > values) and I plot it as regression lines (type="r"), just like this > one (not reproducable but that's > I guess not the point here): > > xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species, > type="r", lty=c(1:6),panel=allo.panel.5) > > The problem is that I've got 26 different values for the grouping > variable species and only 6 default values for the line type > lty (and according to the par {graphics} help page customizable to up > to 8 different line types). > > Does anybody have any idea how these 26 different lines can be made > distinguishable from each other without the use > of colors?If you need to distinguish individual regression lines, I would consider 26 panels rather than attempting one panel with 26 regression lines each of a different line type. Something like this: xyplot(log(AGWB) ~ log(BM_roots) | species, data=sub_agwb_data, type="r", panel=allo.panel.5)> Thanks, > > Katharina > > ______________________________________________ > 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.-- Chuck Cleland, Ph.D. NDRI, Inc. (www.ndri.org) 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894
Bert Gunter
2009-Jun-24 19:43 UTC
[R] distinguish regression lines in grouped, black and white lattice xyplot
Don't be silly. They can't be made "distinguishable" by any number of line types and/or colors. The brain can't keep that many different symbol representations straight. Referring back and forth to a legend is also similarly useless. You need to think more creatively about how to make a more meaningful display to provide viewers interpretable information. Bert Gunter Genentech Nonclinical Biostatistics -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Katharina May Sent: Wednesday, June 24, 2009 12:28 PM To: r-help at r-project.org Subject: [R] distinguish regression lines in grouped,black and white lattice xyplot Hi, I've got the following problem which I cannot think of a solution right now: if got a lattice xyplot in black and white and a grouping variable with many (more than 8 values) and I plot it as regression lines (type="r"), just like this one (not reproducable but that's I guess not the point here): xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species, type="r", lty=c(1:6),panel=allo.panel.5) The problem is that I've got 26 different values for the grouping variable species and only 6 default values for the line type lty (and according to the par {graphics} help page customizable to up to 8 different line types). Does anybody have any idea how these 26 different lines can be made distinguishable from each other without the use of colors? Thanks, Katharina ______________________________________________ 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.
Gabor Grothendieck
2009-Jun-24 22:25 UTC
[R] distinguish regression lines in grouped, black and white lattice xyplot
Perhaps: x <- 1:26 xyplot(x ~ x, groups = x, pch = letters, col = rainbow(26)) On Wed, Jun 24, 2009 at 3:28 PM, Katharina May<may.katharina at googlemail.com> wrote:> Hi, > > I've got the following problem which I cannot think of a solution right now: > > if got a lattice xyplot in black and white and a grouping variable > with many (more than 8 > values) and I plot it as regression lines (type="r"), just like this > one (not reproducable but that's > I guess not the point here): > > xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species, > type="r", lty=c(1:6),panel=allo.panel.5) > > The problem is that I've got 26 different values for the grouping > variable species and only 6 default values for the line type > lty (and according to the par {graphics} help page customizable to up > to 8 different line types). > > Does anybody have any idea how these 26 different lines can be made > distinguishable from each other without the use > of colors? > > Thanks, > > ? ? ? ? Katharina > > ______________________________________________ > 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. >