I would like to know how to plot a correlation matrix similar to the example below using GNUPlot (possibly from Octave, if that makes answers easier, but that’s really not necessary):

The input is a square matrix of values between 0 and 1. The output should be a square grid where the color or the x,y square is given by the value in the xth row and yth column. (Typically, there are only ones on the diagonal and a diagonal symmetry in the input, but that doesn’t change anything to the problem.)
Optionally I would also love to know how to specify the color map.
Using splot
If you have the data in ASCII format then you can plot the matrix with
where
"Data.csv"is the path to the data file.Details about plotting matrices as well as 3D-plots are available here and there.
In order to change the color settings you need to specify a new palette. To specify a new palette for different color schemes, take a look at this documentation. Furthermore tutorials about setting new palettes can be found here.
Using plot
Another way of doing it is:
If the data is binary, the scan direction can be further controlled with
flipx,centerandrotate.