Plotting nxn matrix as a headmap in Gadfly

90 views Asked by At

Hi I am wondering how to plot a heatmap with Gadfly for a n x n matrix. From what I saw the closest thing is Geom.rect or Geom.rectbin, but I am unable to get it in the format of grid.

using Gadfly: Geom, plot
a = rand(3,3)
plot(x = 1:9, y=1:9,color = a, Geom.rectbin)

enter image description here

1

There are 1 answers

1
Ashlin Harris On BEST ANSWER

One option is to use spy():

using Gadfly
a=rand(9,9);
spy(a)

enter image description here