In [4]:
using Plots
default(size=(500,300))
n = 1000
a = rand(n)
y = Float64[i*a[i]+j*a[j] for i in 1:n, j in 1:n]
y = float(y .> mean(y));
In [5]:
spy(y, nbins=(20,100))
Out[5]:
In [6]:
spy(y, nbins=n)
Out[6]:
In [ ]:
# get the indices (I,J) and the values (V) of non-zero values in y
I,J,V = findnz(y);
# plot the J's vs the I's in a heatmap to recreate the spy call
heatmap(J,I)
In [ ]:
pyplot()
In [ ]:
histogram(randn(1000),
In [ ]: