diff --git a/src/recipes.jl b/src/recipes.jl index 48c201bf..5be5b6e0 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -810,30 +810,10 @@ end # Splits a complex matrix to its real and complex parts # Reals defaults solid, imaginary defaults dashed # Label defaults are changed to match the real-imaginary reference / indexing -@recipe function f{T<:Real,T2<:Number}(x::AbstractArray{T},y::Array{Complex{T2}}; - transformation=:split2D) - if transformation==:split2D - A = real.(y) - B = imag.(y) - _y = [!iseven(i) ? A[:,i÷2+1] : B[:,i÷2] for i in 1:2size(A,2)] - linestyle --> reshape([!iseven(i) ? :solid : :dash for i in 1:2size(A,2)],1,2size(A,2)) - label --> reshape([!iseven(i) ? "Re(y$(i÷2+1))" : "Im(y$(i÷2))" for i in 1:2size(A,2)],1,2size(A,2)) - color --> reshape([!iseven(i) ? i÷2+1 : i÷2 for i in 1:2size(A,2)],1,2size(A,2)) - retval = (x,_y) - elseif transformation==:split3D - A = real.(y) - B = imag.(y) - ylabel --> "Re(y)" - zlabel --> "Im(y)" - retval = (x,A,B) - elseif transformation==:modulus - _y = norm.(y) - label --> reshape(["||y$(i)||" for i in 1:size(_y,2)],1,size(_y,2)) - retval = (x,_y) - else - error("Transformation unknown. Please use :split2D, :split3D, or :modulus") - end - (retval...) +@recipe function f{T<:Real,T2}(x::AbstractArray{T},y::Array{Complex{T2}}) + ylabel --> "Re(y)" + zlabel --> "Im(y)" + x,real.(y),imag.(y) end