`Spy` function behavior with sparse matrices

You just need to set the xlims and ylims. I assume this is Plots?
Try:

A = sprand(20,20,.05)
mat1 = spzeros(50,50)
mat1[31:50,31:50] = A 
mat2 = spzeros(50,50)
mat2[1:20,1:20] = A
display(xlims!(ylims!(spy(mat1), (1,50)), (1,50)))
display(xlims!(ylims!(spy(mat2), (1,50)), (1,50)))
1 Like