[R] [lattice] lines for stripplot (like dotplot) or jitter for dotplot?

Deepayan Sarkar deepayan at stat.wisc.edu
Wed Jan 15 20:01:03 CET 2003


On Wednesday 15 January 2003 09:41 am, Michael A. Miller wrote:
> I'd like to use stripplot for some plots because I want to use
> the jitter parameter.  On the other hand, I'd like to use dotplot
> because I'd like to have the horizontal lines that it includes.
> dotplot doesn't have a jitter option and I'm not having any
> success with getting panel.grid(h=-1) with stripplot.  Can anyone
> show me how to make dotplot-like lines on a stripplot?  Or how to
> jitter the vertical plotting position on a dotplot?

In stripplot, try with something like

  panel = function(x, y, ...) {
      panel.abline(h = unique(as.numeric(y)), col = "grey")
      panel.stripplot(x, y, ...)
  }

(or more generally, with col = trellis.par.get("reference.line")$col etc)

Deepayan




More information about the R-help mailing list