필터 지우기
필터 지우기

change width and color of a compass plot

조회 수: 27 (최근 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 CenterFile Exchange에서 2-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