how to change line colors in bodes, nichols, nyquist, etc
조회 수: 37 (최근 30일)
이전 댓글 표시
I've been trying to change the line colors when plotting 30+ systems and it seems like the routines creating the plots in the title are not using the color order in the gca/axis. When I've accessed the handle through following code it seems like there are still a fixed number of colors available, ~6-7
h.Responses(n).Style.Colors{1} =
h.Responses(n).Style.setstyle
When I start adding more lines and setting the colors then all the previous linecolors are also changed, like a circular buffer of some sort is in use. I've just been trying to a jet and it works for 7 or so lines & colors, but does not work for a number like 30+ unique systems
댓글 수: 0
답변 (2개)
Image Analyst
2021년 7월 14일
See attached demo for how to change the default color order.
댓글 수: 2
Image Analyst
2021년 7월 14일
Sometimes you can edit the code and change things. Other times, not, as the m-file calls a mex function.
>> edit nicholsplot.m
See if that gets you anywhere.
Paul
2021년 7월 15일
I tested stepplot and bodeplot and am seeing the same thing as you, i.e., if more than 7 responses, then multiple responses are linked together somehow and share the same color. Don't know why it's set up that way and couldn't find a way to change it, but as far as I can tell it's all undocumented behavior so can't really expect anything.
As a work around, you can use plain old bode() and step() and get the handles to the lines and change colors at will, so it seems to me.
참고 항목
카테고리
Help Center 및 File Exchange에서 Plot Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!