I used ggfluctuation to plot a correlation matrix with missing values. the matrix range is from -1 to +1. the values are represented by the size of red square so missing values are plain gray.
I wonder if there is a way to color negative values in different color say blue.
and here is the code I have used
data = as.matrix(tt)
data[data == 100] = NA
cc <- matrix(data, nr=nrow(data))
ggfluctuation(as.table(cc)) + opts(legend.position="none") +
ggfluctuation(cc, type = "size", floor = 0, ceiling = max(table$freq, na.rm = TRUE))
labs(x="", y="") +
opts(axis.text.x=theme_text(size=4)) +
opts(axis.text.y=theme_text(size=4)) +
scale_x_discrete(labels=rownames(data)) +
scale_y_discrete(labels=rownames(data)) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_fill_discrete(breaks=c("trt1","ctrl","trt2"))
ggsave("cmap2sorted.pdf", width=25, height=25)