Skip to content

Instantly share code, notes, and snippets.

@mortenpi
Created December 29, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenpi/24730ed5f1b6de8976a4 to your computer and use it in GitHub Desktop.
Save mortenpi/24730ed5f1b6de8976a4 to your computer and use it in GitHub Desktop.
Gadfly spy() test
if length(ARGS) != 1
error("Output file name not provided!")
end
ofile = ARGS[1]
println("Writing the plot to: $ofile")
using Gadfly
M,N = 22,30
matrix = zeros(Float64, (M,N))
for i=1:M, j=1:N
matrix[i,j] = abs(i^2 - j^2)
end
p = spy(matrix)
draw(PNG(ofile, 8cm, 8cm), p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment