I need some suggestion of how to plot 2D figures and fill them effectively in R
. I need to visualize some mathematical \"oddities\", for example the Sierpiński
Something like so? Start with a matrix representing your data
mx <- matrix(rep(c(T, F), 5), nrow=3, ncol=3)
# [,1] [,2] [,3]
# [1,] TRUE FALSE TRUE
# [2,] FALSE TRUE FALSE
# [3,] TRUE FALSE TRUE
and then melt/plot:
library(reshape2)
library(ggplot2)
ggplot(melt(mx), aes(x=Var1, y=Var2, fill=value)) + geom_tile()
Is that what you're looking for?