change width and color of a compass plot

18 次查看(过去 30 天)
I have a compass plot (attached) and I want to cnage the line width, color, and type using code not manually. Any help would be greatly appreciated.
Thanks
untitled.jpg

采纳的回答

Ismaeel
Ismaeel 2019-4-11
Thaks Adam, but I use compass function not polarplot.
Anyway, I found my solution in:
using the following code:
Z = compass(eig(randn(5)));
colors = get(0,'DefaultAxesColorOrder')
for i=1:length(Z)
set(Z(i),'color',colors(mod(i-1,length(colors))+1,:),'linewidth',2)
end
Thanks
  1 个评论
Adam Danz
Adam Danz 2019-4-11
编辑:Adam Danz 2019-4-11
It doesn't really matter which plotting function you're using (in most cases). The solution is the same as my answer.

请先登录,再进行评论。

更多回答(1 个)

Adam Danz
Adam Danz 2019-4-11
Use the handle output from the plotting function.
Example:
h = polarplot(theta,rho);
h.LineWidth = 3;
h.Color = 'r';

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by