spy fixes; closes #196

This commit is contained in:
Thomas Breloff 2016-04-26 17:02:16 -04:00
parent 982a512ebd
commit 5c7d31157b

View File

@ -360,9 +360,11 @@ end
"Sparsity plot... heatmap of non-zero values of a matrix" "Sparsity plot... heatmap of non-zero values of a matrix"
function spy{T<:Real}(z::AMat{T}; kw...) function spy{T<:Real}(z::AMat{T}; kw...)
# I,J,V = findnz(z) mat = map(zi->float(zi!=0), z)'
# heatmap(J, I; leg=false, yflip=true, kw...) xn, yn = size(mat)
heatmap(map(zi->float(zi!=0), z); leg=false, yflip=true, kw...) heatmap(mat; leg=false, yflip=true, aspect_ratio=:equal,
xlim=(0.5, xn+0.5), ylim=(0.5, yn+0.5),
kw...)
end end
"Adds a+bx... straight line over the current plot" "Adds a+bx... straight line over the current plot"