How can I right justify the right-axis tick values?  They appear in the
example below as left-justified.

I have tried several different ways and all fail in different ways.

The example below creates the right axis tick value with no attempt at
adjustment.

alternates I have tried are
1. formatting the values.  This doesn't work because they are in a
proportional font and the blanks
are too narrow.

2. gsub all leading " " characters into two "  " characters.  This
overcompenates because a blank
is slightly wider than half a digit width.

I prefer to keep the default font.  I am willing to go to a fixed width font
(courier for example), but I haven't
figured out the incantation to make that work in graphics.

here is my example:

panel.right <- function(x, y, ...) {
  panel.barchart(x, y, ...)
  print(x);print(y)
  panel.axis(side="right", at=pretty(y), outside=TRUE)
}
mybar <- function(...) {
  args <- list(...)
  args$par.settings=list(clip=list(panel="off"))
  args$par.settings$layout.widths$axis.key.padding <- 4
  do.call("barchart", args)
}
mybar(c(1,10,100,10,1) ~ "abcd", panel=panel.right, ylab.right="right")


thanks
Rich

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

Reply via email to