Skip to content

Commit

Permalink
update plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Mar 11, 2019
1 parent e3706c6 commit 6a63c31
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _1(y::VecOrMat) = y[1,:][:]
_1(dmp::AbstractDMP) = _1(dmp.y)
_T(dmp::AbstractDMP) = size(dmp.y,1)

math(sl) = map(s->string("\$",s,"\$") ,sl)
math(sl) = identity(sl) #map(s->string("\$",s,"\$") ,sl)

function euler(time_derivative, state0, t, args...; kwargs...)
T = length(t)
Expand Down Expand Up @@ -120,37 +120,5 @@ plot(dmp::DMP, phase::Bool=false; [y0])
end
end
delete!(plotattributes,:phase)

end


@recipe function plotdmp(dmp::AbstractDMP; phase=false)
tout,yout,ẏout,xout = solve(dmp)[1:4]
n = size(dmp.y,2)
if phase
@series begin
label := ["y_{out}" "ẏ_{out}"] |> math
yout[:,1], yout[:,2]
end
@series begin
linestyle := :dash
label := ["y" ""] |> math
dmp.y[:,1], dmp.y[:,2]
end
else
layout := (n,1)
for i = 1:n
@series begin
label := ["y_{out}" "ẏ_{out}"] |> math
tout,[yout[:,i] ẏout[:,i]]
end
@series begin
linestyle := :dash
label := ["y" ""] |> math
tout,[dmp.y[:,i] dmp.ẏ[:,i]]
end
end
end
delete!(plotattributes, :phase)
nothing
end

0 comments on commit 6a63c31

Please sign in to comment.