@@ -111,7 +111,6 @@ function CSMakie.pzmap!(ax::Axis, systems::Union{LTISystem, AbstractVector{<:LTI
111111 return ax
112112end
113113
114- # ====== Bodeplot ======
115114function CSMakie. bodeplot (systems:: Union{LTISystem, AbstractVector{<:LTISystem}} ,
116115 w= nothing ; plotphase= true , unwrap= true , hz= false ,
117116 balance= true , adjust_phase_start= true , adaptive= true , kwargs... )
@@ -219,7 +218,6 @@ function CSMakie.bodeplot(systems::Union{LTISystem, AbstractVector{<:LTISystem}}
219218 return fig
220219end
221220
222- # ====== Nyquistplot ======
223221function CSMakie. nyquistplot (systems:: Union{LTISystem, AbstractVector{<:LTISystem}} ,
224222 w= nothing ; Ms_circles= Float64[], Mt_circles= Float64[],
225223 unit_circle= false , hz= false , critical_point= - 1 ,
@@ -309,7 +307,6 @@ function CSMakie.nyquistplot(systems::Union{LTISystem, AbstractVector{<:LTISyste
309307 return fig
310308end
311309
312- # ====== Sigmaplot ======
313310function CSMakie. sigmaplot (systems:: Union{LTISystem, AbstractVector{<:LTISystem}} ,
314311 w= nothing ; hz= false , balance= true , extrema= false , kwargs... )
315312 systems_vec = systems isa AbstractVector ? systems : [systems]
@@ -345,7 +342,6 @@ function CSMakie.sigmaplot(systems::Union{LTISystem, AbstractVector{<:LTISystem}
345342 return fig
346343end
347344
348- # ====== Marginplot ======
349345function CSMakie. marginplot (systems:: Union{LTISystem, AbstractVector{<:LTISystem}} ,
350346 w= nothing ; plotphase= true , hz= false , balance= true ,
351347 adjust_phase_start= true , adaptive= true , kwargs... )
@@ -493,7 +489,6 @@ function CSMakie.marginplot(systems::Union{LTISystem, AbstractVector{<:LTISystem
493489 return fig
494490end
495491
496- # ====== Root Locus Plot ======
497492function CSMakie. rlocusplot (P:: LTISystem , K= 500 ; output= false , kwargs... )
498493 # Compute root locus
499494 result = rlocus (P, K; output= output)
@@ -543,7 +538,6 @@ function CSMakie.rlocusplot(P::LTISystem, K=500; output=false, kwargs...)
543538 return fig
544539end
545540
546- # ====== RGA Plot ======
547541function CSMakie. rgaplot (systems:: Union{LTISystem, AbstractVector{<:LTISystem}} ,
548542 w= nothing ; hz= false , balance= true , kwargs... )
549543 systems_vec = systems isa AbstractVector ? systems : [systems]
@@ -616,7 +610,8 @@ function CSMakie.nicholsplot(systems::Union{LTISystem, AbstractVector{<:LTISyste
616610 ℑdata = dropdims (ℑresp, dims= (1 ,2 ))
617611 mag = 20 * log10 .(sqrt .(ℜdata.^ 2 + ℑdata.^ 2 ))
618612 angles = 180 / π* angle .(ℜdata .+ im* ℑdata)
619-
613+ # unwrap angles
614+ ControlSystemsBase. unwrap! (angles)
620615 lines! (ax, angles, mag, linewidth= 2 , label= " System $sysi " )
621616 end
622617
@@ -626,10 +621,6 @@ function CSMakie.nicholsplot(systems::Union{LTISystem, AbstractVector{<:LTISyste
626621 return fig
627622end
628623
629- # ====== Direct plot methods for types ======
630- # These allow direct plotting of types with plot()
631-
632- # Direct plot method for SimResult
633624function Makie. plot (r:: SimResult ; plotu= false , plotx= false , ploty= true )
634625 ny, nu, nx = r. ny, r. nu, r. nx
635626 t = r. t
@@ -684,7 +675,7 @@ function Makie.plot(r::SimResult; plotu=false, plotx=false, ploty=true)
684675 end
685676 end
686677
687- # Plot states
678+ # Plot state
688679 if plotx
689680 for i in 1 : nx
690681 ax = Axis (gl[plotind, 1 ],
@@ -719,7 +710,6 @@ function Makie.plot(r::SimResult; plotu=false, plotx=false, ploty=true)
719710 return fig
720711end
721712
722- # Direct plot method for StepInfo
723713function Makie. plot (si:: StepInfo )
724714 fig = Figure ()
725715 ax = Axis (fig[1 ,1 ],
0 commit comments