Skip to content

Commit de3cc27

Browse files
committed
make MS lines configurable in go7 plot
1 parent 5094c76 commit de3cc27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lqg.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function ControlSystemsBase.gangoffourplot(l::LQGProblem, args...; sigma = true,
569569
Plots.plot(f1,f2,f3,f4)
570570
end
571571

572-
function gangofsevenplot(P, C, F, args...; sigma = true, ylabel="", layout=4, kwargs...)
572+
function gangofsevenplot(P, C, F, args...; sigma = true, ylabel="", layout=4, Ms_lines = [1.0 1.1 1.2], kwargs...)
573573
plots_id = Base.PkgId(UUID("91a5bcdd-55d7-5caf-9e0b-520d859cae80"), "Plots")
574574
haskey(Base.loaded_modules, plots_id) || error("Call using Plots before calling this function")
575575
Plots = Base.loaded_modules[plots_id]
@@ -581,7 +581,9 @@ function gangofsevenplot(P, C, F, args...; sigma = true, ylabel="", layout=4, kw
581581
Plots.plot(; layout, ticks=:default, xscale=:log10, link=:both)
582582
bp(S, args...; show=false, title="S = 1/(1+PC)", sp=1, kwargs...)
583583
# Plots.hline!([1], l=(:black, :dash), primary=false, sp=1)
584-
Plots.hline!([1.0 1.1 1.2], l=(:dash, [:green :orange :red]), sp=1, lab=["1.0" "1.1" "1.2"], ylims=(1e-3,8e1))
584+
if !isempty(Ms_lines)
585+
Plots.hline!(Ms_lines, l=(:dash, [:green :orange :red]), sp=1, lab=["1.0" "1.1" "1.2"], ylims=(1e-3,8e1))
586+
end
585587
bodeplot!(D, args...; show=false, title="PS = P/(1+PC)", plotphase=false, sp=2, kwargs...)
586588
Plots.hline!([1], l=(:black, :dash), primary=false, sp=2)
587589
bodeplot!(CS, args...; show=false, title="CS = C/(1+PC)", plotphase=false, sp=3, kwargs...)

0 commit comments

Comments
 (0)