Skip to content
Prev 379741 / 398502 Next

URGENT help-Problem with panel barplot spacing

I think this is what you want.  You didn't send a reproducible example
(no values for djf.gcms or for cores1).

For what I think you are doing, lattice would be much simpler.  It
handles the repetition within each panel for you.

## generate some data
djf.gcms <- matrix(sample(50, size=9*12, replace=TRUE), 9, 12)

library(lattice)
library(latticeExtra)

djfs <- cbind(stack(data.frame(djf.gcms)), letter=factor(letters[1:9]))
head(djfs)

tmp <-
barchart(letter ~ values | ind, group=letter, col=1:9, data=djfs,
horizontal=TRUE,
         stack=TRUE, type="i",
         scales=list(x=list(alternating=FALSE, axs="i", limits=c(0,59))),
         origin=0, layout=c(4, 3), between=list(x=1, y=2)) +
  layer(panel.text(x=x+5, y, label=x)) +
  layer(panel.abline(v=seq(0,50,10), col="gray"), under=TRUE)
tmp

Rich

The best place to start learning lattice is the trellis book
http://geog.uoregon.edu/GeogR/pdfs/trellis.user.pdf

The definitive reference is Deepayan Sarkar's book,
 Lattice: Multivariate Data Visualization with R
https://www.e-reading.club/bookreader.php/137342/Lattice._Multivariate_Data_Visualization_with_R.pdf

My book (HH2) is
Heiberger, Richard M. and Holland, Burt (2015).
 Statistical Analysis and Data Display: An Intermediate Course with
Examples in R.
 Springer, second edition. ISBN 978-1-4939- 2121-8.
https://www.springer.com/us/book/9781493921218

See HH2 Chapter 4 Graphs for a general discussion
and many examples throughout the book and in the accompanying CRAN package HH.

install.packages("HH")

On Tue, May 28, 2019 at 6:42 AM Kwesi A. Quagraine
<starskykwesi at gmail.com> wrote: