Peter, thanks, but that doesn't work. Did I missed something? library(lattice) mylist <- list(c(0,30), c(40,80), ....) barchart(yield ~ variety | site,data=barley, groups = year, layout = c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space = "right"),ylab = "Barley Yield (bushels/acre)",scales = list(x = list(rot = 45), y=list(relation='free', ylim=mylist)))
On Thu, Apr 22, 2010 at 7:54 PM, Peter Ehlers <ehl...@ucalgary.ca> wrote: > On 2010-04-21 21:13, zhenjiang xu wrote: > >> R experts, >> >> Is there anyway to reorder inside each group? In the following example, >> the >> bar of year 1932 is always plotted before the bar of year 1931, may I >> change >> the order inside each groups of bars? >> >> > Do you mean a different order in different panels? That seems to > me to defeat the purpose of panels. I can't think of an easy way > to do that. > > > library(lattice) >> barchart(yield ~ variety | site,data=barley, groups = year, layout = >> c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space = >> "right"),ylab = "Barley Yield (bushels/acre)",scales = list(x = list(rot = >> 45))) >> >> >> Another questions is: may I specify the various ranges of y axis for each >> row of the panels? In the example of above, how can I change the y range >> of >> "Waseca" panel to (40,70) from the default (0,80)? Please notice I don't >> want to set arguement "scales = list(y=list(relation='free'))", for the >> automatic various setting of ranges for different panels isn't good enough >> for me. Basically I'd like to manually control y ranges. >> > > You can use scales() with > y=list(relation='free', ylim=mylist) > > where mylist is a list of ylims: > mylim <- list(c(0,30), c(40,80), ....) > Peter, thanks, but that doesn't work. Did I missed something? library(lattice) mylist <- list(c(0,30), c(40,80), ....) barchart(yield ~ variety | site,data=barley, groups = year, layout = c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space = "right"),ylab = "Barley Yield (bushels/acre)",scales = list(x = list(rot = 45), y=list(relation='free', ylim=mylist))) > > -Peter Ehlers > > >> Thank you! >> > > -- > Peter Ehlers > University of Calgary > -- Best, Zhenjiang [[alternative HTML version deleted]] ______________________________________________ R-help@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.