On Fri, 24 Aug 2018, Bert Gunter wrote:

For the legend, you can use the full "key" argument for more control.

Bert,

  This I did.

For the scales, again, the docs provide the answer:  the "at" and "labels"
components of "x" component of the scales lists can explicitly control the
x -labels, e.g.

  A bit of trial-and-error got this working, too. Now the plot command works
as desired:

barchart(value ~ year, data=stage_heights,
                    panel = lattice.getOption("panel.barchart"),
                    default.prepanel = 
lattice.getOption("prepanel.default.barchart"),
                    box.ratio = 2, horizontal=FALSE, key=list(c(0.2,0.3), 
columns=2,
                                                              
text=list(c('Median','Maximum')),
                                                              
rect=list(col=c('black', 'grey'))),
                    groups=factor(type,labels=c('Median','Maximum')), 
beside=TRUE,
                    col = c('grey','black'), scales=list(x=list(at=rep(1:29),
                                                                
labels=rep(1989:2018),rot=90)),
                    main = 'Median and Maximum Stage Heights',
                    ylab = 'Elevation (masl)', xlab = 'Year')

(Emacs w/ESS does the formatting). I suppose that the Maximum bar is plotted
to the left because alphabetically it preceeds Medium. I can live with this.

  Deepayan's book was one of the first I bought years ago. I've not before
had plots that required more in-depth knowledge of panels, keys, and scales
so I do appreciate your patient mentoring.

Best regards,

Rich

______________________________________________
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.

Reply via email to