ggplot2 - Add "size"-legend for ggfluctuation plot in R -
i have made "heatmap" similar first 1 here (the grey one): https://stats.stackexchange.com/questions/9050/how-to-display-a-matrix-of-correlations-with-missing-entries
this done using ggfluctuation, part of ggplot2 package.
x=read.table(file="mydata.csv", sep =",", h=t)
row.names(x)<-x[,1]
x<-x[,2:3]
mat=data.matrix(x)
ggfluctuation(as.table(mat)) + theme(legend.position="none") + labs(x="", y="") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + scale_size_area() + labs(title = "main title")
1) make legend, indicates values corresponds diffent sizes of squares - possible
2 ) making multiple heat maps, scale squares same size corresponds same value in of heat maps. can done.
Comments
Post a Comment