library(lattice)
# 10 x 10 の行列を作る
my.nrow = 10
my.ncol = 10
set.seed(123) # sample() で取得する乱数の種を与える
my.mat <- matrix(data = sample(1:100, my.nrow*my.ncol, replace = TRUE),
nrow = my.nrow,
ncol = my.ncol)
xmin <- min(my.mat)
xmax <- max(my.mat)
# Build the plot
pal <- colorRampPalette(c("lightblue", "blue"), space = "rgb")
levelplot(my.mat, main = "10 X 10 Levelplot", xlab = "", ylab = "",
col.regions = pal(20), cuts = 20,
at = seq(from = xmin, to = xmax, by = (xmax-xmin)/20) )
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme