Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia: Plot matrix with Gadfly.jl

Tags:

julia

gadfly

I'm trying to plot a matrix with Gadfly, like I can do with PyPlot's matshow:

using PyPlot

p = eye(5)
p[5,5] = -1

matshow(p)

enter image description here

But I took a look at the docs, and found nothing. How can I do it with Gadfly?

like image 737
prcastro Avatar asked Jul 06 '14 17:07

prcastro


1 Answers

Gadfly has a spy() function which does the same thing.

using Gadfly
p = eye(5)
p[end, end] = -1
spy(p)

You can check out the source for more information.

like image 92
Mr Alpha Avatar answered Oct 26 '22 16:10

Mr Alpha