How can I define my own colororder for a bodeplot?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Scott Tatum
el 8 de En. de 2019
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.
1 comentario
Renan Geraldes
el 1 de Feb. de 2022
Thanks a lot!
Honglei Chen
el 19 de Ag. de 2014
0 votos
You can define your own colormap using colormapeditor
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!