Note though that this does not address the issue of clustering. I’m pretty sure that you’d need to cluster the matrix first, then plot the heatmap. The process of clustering a matrix by rows and columns is called biclustering, and is “soon to be implemented” in MLMetrics.jl.
For the clustering you can use the Clustering package:
using Clustering, Distributions
# build a matrix with 4 classes
μ = rand(4)*20
μ = StatsBase.sample(μ,100)
M = hcat([rand(Normal(μ,1),200) for μ in μ]...)
# cluster it
c = kmeans(M,4)
idx = sortperm(assignments(c))
M = M[:,idx]
# use you favorite heatmap plot
image(M)