Matthew McMaster
Reputation
Top tag
Next privilege 100 Rep.
Edit community wikis
 Apr19 awarded Popular Question Sep13 accepted What is the best way to create a correlation matrix heatmap with values? Sep13 awarded Nice Question Sep12 comment What is the best way to create a correlation matrix heatmap with values? Just wanted to add that in the ColorFunction you could use Rescale[#, {-1, 1}]. Of course its the same transformation but just for clarity sake. Sep12 comment What is the best way to create a correlation matrix heatmap with values? Thanks @PlatoManiac for the editing help. Sep12 awarded Scholar Sep12 awarded Supporter Sep12 comment What is the best way to create a correlation matrix heatmap with values? Thank you, that looks like what I was trying to do. Greatly appreciate the work! Sep12 comment What is the best way to create a correlation matrix heatmap with values? Perhaps I'm not understanding the image posted above but it appears that the plot is using the smallest number (-0.28) as the gradient limit which shows as a dark blue while 0.16 is showing as the most neutral (rather than values closer to 0). Sep12 awarded Student Sep12 comment What is the best way to create a correlation matrix heatmap with values? Thank you, that looks quite close. Is there a good way to rescale the gradient so that 0. would be white(ish) and -1 (if it existed) would be the darkest shade of blue with negative numbers of blue hues and positive numbers red hues? Sep12 comment What is the best way to create a correlation matrix heatmap with values? I added a slightly better example to my original post, hopefully that helps. This would produce roughly what I'm looking for but with a couple of important issues. 1) the gradient isn't indexed properly (in the example -0.8 is the same as -1 in color) and 2) I'd like some way of including the values on top of the colors. Sep12 awarded Editor Sep12 revised What is the best way to create a correlation matrix heatmap with values? added improved example Sep12 comment What is the best way to create a correlation matrix heatmap with values? Sure, this is a very simplified example but I figure I can extend a solution. data = {{1, 2, 3, 4}, {1.5, 1.7, 1.2, .5}}; ArrayPlot[Correlation[data[Transpose]], ColorFunction -> "TemperatureMap", Frame -> None, Mesh -> True] The data is made up, but basically I want deep blue to represent -1 and red to represent 1 with gradient in between if possible. Sep12 asked What is the best way to create a correlation matrix heatmap with values?