0

I have made a "heatmap" similar to the first one here (the grey one): https://stats.stackexchange.com/questions/9050/how-to-display-a-matrix-of-correlations-with-missing-entries

This was done using ggfluctuation, which is part of the 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) I would like to make a legend, which indicates the values that corresponds to the diffent sizes of the squares - is that possible

2 ) I am making multiple heat maps, so I would like to scale the squares so the same size corresponds to the same value in all of my heat maps. Can this by done.

Community
  • 1
  • 1
user2335015
  • 111
  • 11
  • Welcome to Stack Overflow. You will get more and better answers if you create a question that includes data and code so that we can just copy and paste into our own R setups. [This post](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) is the one you should read first. Then come back here and edit your question. If your data is proprietary, make fake data with random values - again, see the post just linked. Keep the code as concise as possible. I find that the process of asking a minimal question with code and data often reveals the answer right there. – SlowLearner Jul 25 '13 at 10:30
  • As we don't have access to `mydata.csv` the code in your edited question isn't reproducible. Suggest you define `x` using the `data.frame` function and some randomly generated data; refer for guidance to the post linked to above. – SlowLearner Jul 25 '13 at 12:48

0 Answers0