Re: [R] lattice grayscale "theme"
On 7/30/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > "Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > > On 7/30/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > >> The Gmane interface seems to have some lag at the moment... > >> > >> "Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > >> > >> > On 7/28/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > >> >> > >> >> is there a grayscale setting for lattice plots? > [...] > >> >> Is there a simple way of achieving something in between these > >> >> settings (using grayscales for the default colors)? > >> > > >> > Possibly, but you would have to define what you mean by 'simple' > >> > and 'something in between' more precisely. > >> > >> Here is an example of 'in between': > >> > >> --8<---cut here---start->8--- > >> ## Set background color of strips to grayscales: > >> strip.background <- trellis.par.get("strip.background") > >> trellis.par.set(strip.background = list(col = grey(7:1/8))) > >> ## Set color of plot symbols to grayscale: > >> plot.symbol <- trellis.par.get("plot.symbol") > >> trellis.par.set(plot.symbol = list(col = grey(5/8))) > >> --8<---cut here---end--->8--- > > > > Well, there you go. You have a new theme. > > Thanks for confirming that I am on the right track! > > >> I think it would be nice to have a few default "themes": A single > >> switch between "default color", "grayscale" and "black and white". > > > > I'm still not sure what qualities you are looking for in the new > > theme. > > Goal: > > Lattice should have good default settings for color, grayscale and > b&w. > > The user should not be bothered with the details (similar to using > LaTeX: Many users do not have any idea of DEK's typesetting in the > background). > > Lattice functions should provide reasonable default settings. > > The default colors for the lattice suite were chosen for a reason > (very good choice for color display). > > IMO the default grayscale colors should be wrapped into a similar > default-suite after discussion of which grayscales are best suited for > printing with different common resolutions using b/w printers. > > After this has been decided upon, it might be nice to have something > along the lines of: > > lattice.options(default.theme = [color|gray|bw]) > > Have I described my concern elaborately enough? Yes, and I agree that in principle it would be a good thing to have. Personally, I don't believe such a theme can be made (at least not one that's generally useful) and will not spend time trying to create one. I'm happy to add one to lattice if anyone contributes it. -Deepayan __ R-help@stat.math.ethz.ch 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.
Re: [R] lattice grayscale "theme"
The Gmane interface seems to have some lag at the moment... "Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > On 7/28/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: >> >> is there a grayscale setting for lattice plots? >> >> I like the default color settings. I also like the settings that are >> available for setting black and white with something like this: >> >> --8<---cut here---start->8--- >> ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme >> ltheme$strip.background$col <- "transparent" ## change strip bg >> lattice.options(default.theme = ltheme) ## set as default >> --8<---cut here---end--->8--- >> >> Is there a simple way of achieving something in between these settings >> (using grayscales for the default colors)? > > Possibly, but you would have to define what you mean by 'simple' and > 'something in between' more precisely. Here is an example of 'in between': --8<---cut here---start->8--- ## Set background color of strips to grayscales: strip.background <- trellis.par.get("strip.background") trellis.par.set(strip.background = list(col = grey(7:1/8))) ## Set color of plot symbols to grayscale: plot.symbol <- trellis.par.get("plot.symbol") trellis.par.set(plot.symbol = list(col = grey(5/8))) --8<---cut here---end--->8--- I think it would be nice to have a few default "themes": A single switch between "default color", "grayscale" and "black and white". What do you think? Cheers, Patrick -- We are sorry, but the number you have dialed is imaginary. Please rotate your phone 90 degrees and try again. __ R-help@stat.math.ethz.ch 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.
Re: [R] lattice grayscale "theme"
"Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > On 7/30/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: >> The Gmane interface seems to have some lag at the moment... >> >> "Deepayan Sarkar" <[EMAIL PROTECTED]> writes: >> >> > On 7/28/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: >> >> >> >> is there a grayscale setting for lattice plots? [...] >> >> Is there a simple way of achieving something in between these >> >> settings (using grayscales for the default colors)? >> > >> > Possibly, but you would have to define what you mean by 'simple' >> > and 'something in between' more precisely. >> >> Here is an example of 'in between': >> >> --8<---cut here---start->8--- >> ## Set background color of strips to grayscales: >> strip.background <- trellis.par.get("strip.background") >> trellis.par.set(strip.background = list(col = grey(7:1/8))) >> ## Set color of plot symbols to grayscale: >> plot.symbol <- trellis.par.get("plot.symbol") >> trellis.par.set(plot.symbol = list(col = grey(5/8))) >> --8<---cut here---end--->8--- > > Well, there you go. You have a new theme. Thanks for confirming that I am on the right track! >> I think it would be nice to have a few default "themes": A single >> switch between "default color", "grayscale" and "black and white". > > I'm still not sure what qualities you are looking for in the new > theme. Goal: Lattice should have good default settings for color, grayscale and b&w. The user should not be bothered with the details (similar to using LaTeX: Many users do not have any idea of DEK's typesetting in the background). Lattice functions should provide reasonable default settings. The default colors for the lattice suite were chosen for a reason (very good choice for color display). IMO the default grayscale colors should be wrapped into a similar default-suite after discussion of which grayscales are best suited for printing with different common resolutions using b/w printers. After this has been decided upon, it might be nice to have something along the lines of: lattice.options(default.theme = [color|gray|bw]) Have I described my concern elaborately enough? > An upcoming version of the latticeExtra package will have a function > that can be used to create a theme based on some given colors; you > might find it useful. It uses colors from RColorBrewer by default, > and looks like: This looks very interesting, thanks for keeping the development going! Cheers, Patrick __ R-help@stat.math.ethz.ch 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.
Re: [R] lattice grayscale "theme"
On 7/30/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > The Gmane interface seems to have some lag at the moment... > > "Deepayan Sarkar" <[EMAIL PROTECTED]> writes: > > > On 7/28/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > >> > >> is there a grayscale setting for lattice plots? > >> > >> I like the default color settings. I also like the settings that are > >> available for setting black and white with something like this: > >> > >> --8<---cut here---start->8--- > >> ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme > >> ltheme$strip.background$col <- "transparent" ## change strip bg > >> lattice.options(default.theme = ltheme) ## set as default > >> --8<---cut here---end--->8--- > >> > >> Is there a simple way of achieving something in between these settings > >> (using grayscales for the default colors)? > > > > Possibly, but you would have to define what you mean by 'simple' and > > 'something in between' more precisely. > > Here is an example of 'in between': > > --8<---cut here---start->8--- > ## Set background color of strips to grayscales: > strip.background <- trellis.par.get("strip.background") > trellis.par.set(strip.background = list(col = grey(7:1/8))) > ## Set color of plot symbols to grayscale: > plot.symbol <- trellis.par.get("plot.symbol") > trellis.par.set(plot.symbol = list(col = grey(5/8))) > --8<---cut here---end--->8--- Well, there you go. You have a new theme. > I think it would be nice to have a few default "themes": A single > switch between "default color", "grayscale" and "black and white". I'm still not sure what qualities you are looking for in the new theme. An upcoming version of the latticeExtra package will have a function that can be used to create a theme based on some given colors; you might find it useful. It uses colors from RColorBrewer by default, and looks like: brewer.theme <- function(symbol = brewer.pal(n = 8, name = "Dark2"), fill = brewer.pal(n = 12, name = "Set3"), region = brewer.pal(n = 11, name = "Spectral"), reference = "#e8e8e8", bg = "transparent", fg = "black") { theme <- list(plot.polygon = list(col = fill[1], border = fg[1]), box.rectangle = list(col= symbol[1]), box.umbrella = list(col= symbol[1]), dot.line = list(col = reference), dot.symbol= list(col = symbol[1]), plot.line = list(col = symbol[1]), plot.symbol = list(col= symbol[1]), regions = list(col = colorRampPalette(region)(100)), reference.line= list(col = reference), superpose.line= list(col = symbol), superpose.symbol = list(col = symbol), superpose.polygon = list(col = fill, border = fg), background= list(col = bg), add.line = list(col = fg), add.text = list(col = fg), box.dot = list(col = fg), axis.line = list(col = fg), axis.text = list(col = fg), strip.border = list(col = fg), box.3d= list(col = fg), par.xlab.text = list(col = fg), par.ylab.text = list(col = fg), par.zlab.text = list(col = fg), par.main.text = list(col = fg), par.sub.text = list(col = fg)) modifyList(standard.theme("pdf"), theme) } -Deepayan __ R-help@stat.math.ethz.ch 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.
Re: [R] lattice grayscale "theme"
On 7/28/07, Patrick Drechsler <[EMAIL PROTECTED]> wrote: > Hi, > > is there a grayscale setting for lattice plots? > > I like the default color settings. I also like the settings that are > available for setting black and white with something like this: > > --8<---cut here---start->8--- > ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme > ltheme$strip.background$col <- "transparent" ## change strip bg > lattice.options(default.theme = ltheme) ## set as default > --8<---cut here---end--->8--- > > Is there a simple way of achieving something in between these settings > (using grayscales for the default colors)? Possibly, but you would have to define what you mean by 'simple' and 'something in between' more precisely. help(trellis.par.set) tells you how to change settings, and you can use it to change all the components you want (and the colors can of course be greyscale). -Deepayan __ R-help@stat.math.ethz.ch 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.
Re: [R] lattice grayscale "theme"
Patrick Drechsler <[EMAIL PROTECTED]> writes: > is there a grayscale setting for lattice plots? Solved using ## Set background color of strips to grayscales: strip.background <- trellis.par.get("strip.background") trellis.par.set(strip.background = list(col = grey(7:1/8))) ## Set color of plot symbols to grayscale: plot.symbol <- trellis.par.get("plot.symbol") trellis.par.set(plot.symbol = list(col = grey(5/8))) Patrick __ R-help@stat.math.ethz.ch 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] lattice grayscale "theme"
Hi, is there a grayscale setting for lattice plots? I like the default color settings. I also like the settings that are available for setting black and white with something like this: --8<---cut here---start->8--- ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme ltheme$strip.background$col <- "transparent" ## change strip bg lattice.options(default.theme = ltheme) ## set as default --8<---cut here---end--->8--- Is there a simple way of achieving something in between these settings (using grayscales for the default colors)? Thankful for any pointers, Patrick __ R-help@stat.math.ethz.ch 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.