Plot with a grid


I am looking for a type of plot that is essentially a grid. For example, there will be 10 columns and 50 rows. For example, something like this:

enter image description here

Each of the boxes (in this case, 10*50 = 500) will have a unique value that I will be providing via a data frame. Based on the unique values, I'll have a function that will assign a colour to each box. So then it becomes a grid to visualize "the range" of each box. I'd also need to label each of the columns (probably vertically so all labels fit) and rows (horizontally).

I just don't know what kind of plot that will be and I don't know if any libraries do this. I'm just looking for some help in finding something that does this. I'd appreciate some help if possible.


Answers:


How about heatmap?

m=matrix(runif(12),3,4)
rownames(m)=c("Me","You","Him")
colnames(m)=c("We","Us","Them","I")
heatmap(m,NA,NA)

enter image description here

Note that it works on a matrix and not a data frame because all the values have to be numbers, and data frames are row-oriented records.

See the help for other options.