title: How to add points to multi-panel Lattice graphics bwplot?
body: <p>I'm making box-and-whisker plots in Lattice with bwplot.  I want to add points for means.  I've figured out how to do this for simple plots using <code>panel.points</code>.  However, when I make a multi-panel bwplot using <code>+</code> and <code>outer=TRUE</code>, I don't know how to put different points in different panels.  This example illustrates the problem with my attempted solution, which doesn't work.  (For the sake of simplicity, it puts "x"s at arbitrary points rather than at means.)</p>
  
  <pre><code># make some data:
  df &lt;- data.frame(var1=rnorm(20), var2=runif(20), cat=rep(c("Z"),20))
  # cat isn't doing anything, but I couldn't get the mwe to work without it.
  
  bwplot(var1 + var2 ~ cat, data=df, pch="|", coef=0, outer=TRUE, 
         panel=function(data, ...){
           panel.bwplot(...)
           panel.points(x=c(.5,-.5), pch="x", cex=2)
         }
        )
  </code></pre>
  
  <p>(<code>outer=T</code> combined with <code>var1 + var2</code> is what causes two panels to be created.  See below for a simpler example.)</p>
  
  <p>What I get are two panels, with a box-and-whisker plot in each.  "x"s are placed over each plot.  In each panel, there is an "x" at .5 over the plot.  Rather than using -.5 in the second panel, the process starts over--Lattice grabs the first point, .5, again.</p>
  
  <p>How can I get different points displayed over plots in different panels?</p>
  
  <p>Thanks.</p>
  
  <p>Later addition: I realize now that this issue has nothing to do with <code>+</code> and <code>outer=TRUE</code> per se.  The same behavior can be gotten using routine Lattice conditioning:</p>
  
  <pre><code>df &lt;- data.frame(var1=rnorm(20), cat=rep("Z",20), cat2=rep(c("M","F"), 10))
  
  bwplot(var1 ~ cat | cat2, data=df, pch="|", coef=0, outer=TRUE, 
             panel=function(data, ...){
               panel.bwplot(...)
               panel.points(x=c(.5,-.5), pch="x", cex=2)
             }
            )
  </code></pre>