Open ramnathv opened 10 years ago
These are the two pieces in the code that are to be tweaked. I need to scale the units across the two dimensions such that I always end up creating squares.
plot(1, 1, xlim = c(0, o + 1), ylim = c(n + 1, 0), type = "n",
axes = FALSE, xlab = "", ylab = ""
)
...
for (i in 1:n){
for (j in 1:o) {
rect(j - gap, i + 0.5, j + gap, i - 0.5,
col = data[i, j], xpd = TRUE, border = 'white'
)
}
}
I still have rectangles instead of squares while drawing data frames. This arises due to the gap
variable I introduced to leave a gap between columns to distinguish data frames from matrices. I need to rewrite the code a bit so that I am drawing squares, but there is still a gap between columns.
Suggestion from Paul Murrell
Always produce squares instead of rectangles, even when nrow != ncol. I need to tweak the basic
plot
function to scale the two dimensions appropriately while drawing.