在R中以十六进制显示轴值

时间:2015-12-04 02:32:38

标签: r

如何在散点图中以R的十六进制显示轴?我从CSV读取的数据已经是十六进制的。

我试图显示内存访问,这是我当前的代码:

vec <- read.csv("http://www.upl.cs.wisc.edu/~riccardo/entropy1-debian-clean.csv")
y <- vec$high
x <- vec$low

plot(x, y, main="Memory Accesses", 
     xlab="Low 32-bits ", ylab="High 32-bits ", pch=19, cex=0.1)

显示:

scatter plot for memory accesses

1 个答案:

答案 0 :(得分:2)

正如我在写这个答案时由rawr所指出的(注意0:6 * 10000比我写的更好,但不想偷它):

plot(x, y, main="Memory Accesses", xaxt = "n", yaxt = "n",
     xlab="Low 32-bits ", ylab="High 32-bits ", pch=19, cex=0.1)
axis(1, seq(0,60000,10000), paste0("0x",as.hexmode(seq(0,60000,10000))))
axis(2, seq(0,60000,10000), paste0("0x",as.hexmode(seq(0,60000,10000))))

enter image description here