module O
using Plots
struct Wireframe{F, X, Y}
f::F
x::X
y::Y
end
vecwithnan(X) = [
vec([X ; fill(NaN, 1, size(X, 2))])
vec([X'; fill(NaN, 1, size(X', 2))])
]
@recipe function f(wf::Wireframe)
f, x, y = wf.f, wf.x, wf.y
X, Y = reim(complex.(x', y))
XX, YY = vecwithnan(X), vecwithnan(Y)
ZZ = f.(XX, YY)
XX, YY, ZZ
end
@recipe function f(wf::Wireframe{<:AbstractMatrix})
Z, x, y = wf.f, wf.x, wf.y
X, Y = reim(complex.(x', y))
XX, YY, ZZ = vecwithnan(X), vecwithnan(Y), vecwithnan(Z)
XX, YY, ZZ
end
end