I have a 16x16 matrix of grayscale values representing handwriting digits. Is there a plot in R that I can use to visualize it?
Matlab has pcolor, I am looking for something along those lines. pcolor
I have a 16x16 matrix of grayscale values representing handwriting digits. Is there a plot in R that I can use to visualize it?
Matlab has pcolor, I am looking for something along those lines. pcolor
There are many options for something like this. One option is to use the geom_tile
in ggplot2:
library(ggplot2)
ggplot(melt(volcano), aes(x=X1, y=X2, fill=value)) + geom_tile()
Ends up looking like this:
Some other options include: levelplot
(in lattice) or color2D.matplot
(in plotrix).
No need to go to extra packages. Base R already has this, see
help(image)
help(heatmap)
and Romain's excellent R Graph Gallery which has a searchable index.