Spy

Source code Author Update time

using Plots
pythonplot()

For a matrix mat with unique nonzeros spy(mat) returns a colorless plot. If mat has various different nonzero values, a colorbar is added. The colorbar can be disabled with legend = nothing.

using SparseArrays
a = spdiagm(0 => ones(50), 1 => ones(49), -1 => ones(49), 10 => ones(40), -10 => ones(40))
b = spdiagm(0 => 1:50, 1 => 1:49, -1 => 1:49, 10 => 1:40, -10 => 1:40)
plot(spy(a), spy(b), title = ["Unique nonzeros" "Different nonzeros"])
2023-08-30T09:34:49.456708 image/svg+xml Matplotlib v3.7.2, https://matplotlib.org/

This page was generated using DemoCards.jl and Literate.jl.