How to change log-log values ​​from exponential notation to numerical values ​​in the lattice package?

For example, what should I add to this expression:

xyplot(a~b, groups=abc, data=super, scales=list(x=list(log=TRUE),y=list(log=TRUE)), panel = panel.grid) 

to have 100 instead of 10 ^ 2?

+4
source share
1 answer

The latticeExtra package has a number of great features to create brighter labels for the logarithmic axes. In your case, see xscale.components.log10ticks .

Here is an example taken from the man page which basically shows what you want (although here it is the y axis, which gets the markings you want on the x axis):

  xyplot((1:200)/20 ~ (1:200)/20, type = c("p", "g"), scales = list(x = list(log = 2), y = list(log = 10)), xscale.components = xscale.components.fractions, yscale.components = yscale.components.log10ticks) 

enter image description here


EDITED by providing an additional example to respond to the comments of the original poster

 library(latticeExtra) dat <- 10^seq(-3, 5) options(scipen=10) options(digits=10) xyplot(dat ~ dat, type = c("p", "g"), scales = list(x = list(log = 2), y = list(log = 10)), xscale.components = xscale.components.log10ticks, yscale.components = yscale.components.log10ticks) 

enter image description here

+7
source

Source: https://habr.com/ru/post/1396509/


All Articles