library
(RColorBrewer)
A =
matrix
(
c
(1,2,0,3,4,0,2,1,3,3,0,0,4,
4,1,4,3,1,4,3,0,2,1,1,4),
nrow = 5, ncol = 5)
heatmap
(A, Rowv =
NA
, Colv =
NA
,
col =
colorRampPalette
(
brewer.pal
(8,
"Blues"
))(3))
legend
(x =
"bottomright"
, legend =
c
(
"low"
,
"medium"
,
"high"
),
cex = 0.8, fill =
colorRampPalette
(
brewer.pal
(8,
"Blues"
))(3))