Skip to content

Commit 7b4c1aa

Browse files
authored
Merge pull request #760 from JuliaControl/rlocfix
Include zeros when calculating lims for rlocus
2 parents f3521c1 + 132997f commit 7b4c1aa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/src/examples/example.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ DocTestSetup = quote
44
plotsDir = joinpath(dirname(pathof(ControlSystems)), "..", "docs", "build", "plots")
55
mkpath(plotsDir)
66
nyquistplot(ssrand(1,1,1)) # to get the warning for hover already here
7-
save_docs_plot(name) = Plots.savefig(joinpath(plotsDir,name))
8-
save_docs_plot(p, name) = Plots.savefig(p, joinpath(plotsDir,name))
7+
save_docs_plot(name) = (Plots.savefig(joinpath(plotsDir,name)); nothing)
8+
save_docs_plot(p, name) = (Plots.savefig(p, joinpath(plotsDir,name)); nothing)
99
end
1010
```
1111

src/root_locus.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ rlocusplot
6262
roots, K = getpoles(P,K)
6363
redata = real.(roots)
6464
imdata = imag.(roots)
65+
all_redata = [vec(redata); real.(Z)]
66+
all_imdata = [vec(imdata); imag.(Z)]
6567

66-
ylims --> (max(-50,minimum(imdata) - 1), min(50,maximum(imdata) + 1))
67-
xlims --> (max(-50,minimum(redata) - 1), clamp(maximum(redata) + 1, 1, 50))
68+
ylims --> (max(-50,minimum(all_imdata) - 1), min(50,maximum(all_imdata) + 1))
69+
xlims --> (max(-50,minimum(all_redata) - 1), clamp(maximum(all_redata) + 1, 1, 50))
6870
framestyle --> :zerolines
6971
title --> "Root locus"
7072
xguide --> "Re(roots)"

0 commit comments

Comments
 (0)