带有对数轴的R xyplot以十进制格式显示数字

问题描述 投票:0回答:1

我有一个使用xyplot在library(lattice)中绘制的图。我使用对数以2为底的比例尺作为y轴。我访问的数字显示为2 ^ 0、2 ^ 2、2 ^ 4。我将如何使用相同的比例,但将数字以正常格式显示为1、4、16,而不是上面的格式。我查找了一些格式命令,但对我不起作用。这是我使用的xyplot命令。

xyplot(Conc~hr_Nominal, data_6681, type="b", groups = location, 
   auto.key = list(corner = c(1, 0), x = 0.95, y = 0.8),
   scales = list(y = list(log = 2)))

感谢任何帮助。

r numbers format scale lattice
1个回答
0
投票

我认为这可以解决。顺便说一句,如果在OP library(lattice)中指定软件包,将很有帮助。由于我没有您的数据,因此无法在我的计算机上运行它。请让我知道它是否无效。

xyplot(Conc ~ hr_Nominal, data_6681, type = "b", groups = location, 
   auto.key = list(corner = c(1, 0), x = 0.95, y = 0.8),
   scales = list(y = list(log = 2), equispaced.log = FALSE)) 
© www.soinside.com 2019 - 2024. All rights reserved.