Color on each branch of rootlocus
See original GitHub issueWhen 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:
- Created 4 years ago
- Comments:8 (6 by maintainers)

Top Related StackOverflow Question
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:
– 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)
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.