juliagadfly

Plotting nxn matrix as a headmap in Gadfly


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


Solution

  • One option is to use spy():

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

    enter image description here