How to change the color and remove values from wind rose?
조회 수: 2 (최근 30일)
이전 댓글 표시
I would like to change the color of my wind rose, but the code which I used does not work properly. After applying the code, which is below, I received the result which is attached below. I would also like to remove the values 100000-400000 from the image and the values for angles. Any suggestions? Thank you in advance.
h=rose(A*pi/180,16); % A is my data
view(90, -90);
set(h, 'LineWidth',1,'Color','k');
x=get(h,'Xdata');
y=get(h,'Ydata');
g=patch(x,y,'k');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149354/image.png)
댓글 수: 0
채택된 답변
Joseph Cheng
2015년 9월 23일
I think i understand what you're trying to accomplish so you can try something like the example below:
%generate some dummy data
A = -abs(pi*randn(10000,1));
%display the rose
h=rose(A,16)
view(90,-90)
set(h, 'LineWidth',1,'Color','k');
%get lines for patching
x=get(h,'Xdata');
y=get(h,'Ydata');
%if you examine the x and y you see that the points are in order but go to (0,0)
%if deletion of 0 data from x,y points it should only have the perimeter
todel = x==0;
x(todel)=[];
y(todel)=[];
g=patch(x,y,'k');
%adjust the transparency of the patch so the internal lines show up
set(g,'facealpha',.5)
%now to delete angles and values
txt = findall(gcf,'type','text');
% delete the text objects
delete(txt);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!