change width and color of a compass plot

17 ビュー (過去 30 日間)
Ismaeel
Ismaeel 2019 年 4 月 11 日
編集済み: Adam Danz 2019 年 4 月 11 日
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 Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by