question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Color on each branch of rootlocus

See original GitHub issue

When using the rootlocus function the plot containing all the branches does not differentiate between branches. All of them are colored with the same blue.

I found a walkthrough for this, but you need to know well the transfer function you want to plot, like: system=control.tf([1],np.convolve(np.polyadd(np.convolve([1,1],[1,1]),4),np.polyadd(np.convolve([1,3],[1,3]),4))) control.root_locus(system) plt.gca().get_lines()[1].set_color('b') plt.gca().get_lines()[2].set_color('r') plt.gca().get_lines()[3].set_color('g') plt.gca().get_lines()[4].set_color('m')

Where poles are the line [0], and the rest are the different branches. If you have zeros, then they are located in line[1], and the branches in [2],…

Is there any possibilty of colouring the different branches as MATLAB does?

Thank you for this module, I found it very useful!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sawyerbfullercommented, Aug 15, 2021

I like the colored branches. I had what I thought was an example where it might fail, but I couldn’t find it.

Re multiple rloci: i think it would be good provide some sort of an optional color-sequence argument. Which you would just set to a single color if desired, or to your own color sequence. I think matplotlib has features to do this, but I don’t know what it is called. S

On Sun, Aug 15, 2021 at 7:12 AM Bill Tubbs @.***> wrote:

One time when different colours per locus might be a bad idea, is when plotting the root loci of more than one system on the same plot. Is this actually useful or something that we want to support? If so, we could offer both options.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/python-control/python-control/issues/350#issuecomment-899056902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN74SSIK4Z5XZ7CBFFIMN2LT47DKHANCNFSM4JVV54RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

– Sawyer Fuller Assistant Professor of Mechanical Engineering Adjunct, Paul G Allen School of Computer Science University of Washington http://faculty.washington.edu/~minster/

(Typed with my thumbs)

0reactions
billtubbscommented, Aug 15, 2021

One time when different colours per locus might be a bad idea, is when plotting the root loci of more than one system on the same plot. Is this actually useful or something that we want to support? If so, we could offer both options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Root Locus
Each branch is displayed in a different color. Start/End Points. Root locus starts (K=0) at poles of open loop transfer function, G(s)H(s).
Read more >
How to identify branches of root locus from figure/plot?
The number of branches will be equal your number of poles. The different colored lines should indicate each branch (unless you're colorblind ...
Read more >
Root Locus Plot 3.4 - Electronics Tutorials - CircuitBread
1. Zero at s = -3. So, now the open-loop transfer function becomes. The root locus obtained is. As we discussed, we can...
Read more >
The Root Locus Rules
Branches of the root locus lie on the real axis to the left of an odd number of poles and zeros. Complex-conjugate pairs...
Read more >
Root locus plot of dynamic system - MATLAB rlocus - MathWorks
plots the root loci of multiple LTI models sys1, sys2,... on a single plot. You can specify a color, line style, and marker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found