[Rd] infelicity with axTicks

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sun Jun 22 17:13:33 CEST 2025


On 2025-06-22 8:15 a.m., Spencer Graves wrote:
> If the range fed to axTicks is too narrow, the output is only 2 points;
> shouldn't it degenerate to using "pretty" in such cases?
> 
> 
> EXAMPLE:
> 
> 
> ylims2 <- c(0.2, 0.8)
> get_axp <- function(x) 10^c(ceiling(x[1]), floor(x[2]))
> ## mimic par("yaxs") == "i"
> usr.i2 <- log10(ylims2)
> (aT.i2 <- axTicks(side = 2, usr = usr.i2,
>         axp = c(get_axp(usr.i2), n = 3), log = TRUE, nintLog = 5))
> #[1] 0.2 0.5

I don't understand your point.  If I do

   plot(ylims2, ylims2, log="xy", yaxs="i", xaxs="r")

then both axes get ticks at the pretty(ylims2) locations.  If I set yaxp 
or xaxp to the  values you used, then I get c(0.2, 0.5), but why would I 
do that?

Duncan Murdoch



More information about the R-devel mailing list