(complex) type recipe

This commit is contained in:
ChrisRackauckas 2017-04-16 13:14:12 -07:00
parent 7def4e8e73
commit 0be0824207

View File

@ -801,12 +801,10 @@ datetimeformatter(dt) = string(convert(DateTime, dt))
# ------------------------------------------------- # -------------------------------------------------
# Complex Numbers # Complex Numbers
@userplot ComplexPlot @recipe function f{T<:Number}(A::Array{Complex{T}})
@recipe function f(cp::ComplexPlot) xguide --> "Re(x)"
xguide --> "Real Part" yguide --> "Im(x)"
yguide --> "Imaginary Part" real.(A), imag.(A)
seriestype --> :scatter
real(cp.args[1]), imag(cp.args[1])
end end
# Splits a complex matrix to its real and complex parts # Splits a complex matrix to its real and complex parts