How can I define my own colororder for a bodeplot?
이전 댓글 표시
Hi, I would like to plot up to 20 bodeplots in the same graph with a specified colororder. I have tried two different ways of doing this, but none of them works:
1) figure; color_order = copper(20); set(gcf,'DefaultAxesColorOrder',color_order) hold all for i = 1:20 bodeplot(models{i}); end
I have also tried by setting the default colororder for the whole matlab session with set(0,'DefaultAxesColorOrder',color_order), but this doesn't affect the color order for the bodeplot either.
2) figure;hold; color_order = copper(20); for i = 1:20 bodeplot(models{i},color_order(i)); end
Nr 2 does not work since bodeplot does not seem to take rgb-colors. I have also tried
figure;hold; color_order = copper(20); for i = 1:20 bodeplot(models{i},'Color',color_order(i)); end
Cheers, Anna-Maria
채택된 답변
추가 답변 (2개)
Scott Tatum
2019년 1월 8일
So I know this is a bit of an older question but just came across it myself. After looking through a few answers I found the following (in 2017b):
h = bodeplot(sys,w,options);
h.Responses(n).Style.Colors{1} = cols(n,:); % set the color
h.Responses(n).Style.LineStyles{1} = stys{n}; % set the line style
h.Responses(n).Style.setstyle % make the changes show
This allowed me to set custom colors and line styles progromatically for each sys that I plotted on a figure.
Honglei Chen
2014년 8월 19일
0 개 추천
You can define your own colormap using colormapeditor
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!