problem with filling roseplot - truncated colours

Hi, I am trying to fill my roseplot, but it keeps giving me strange truncations / ends... What is going wrong?
rdir =[270 190 100 250 270 330 250 30 300 310 180 250 350 310 250 260 250 350 290 220 340 250] /180 *pi();
% version 1
h = rose(rdir); x = get(h, 'XData'); y = get(h, 'YData'); p = patch(x, y, 'r') ;
view(90,270);

 采纳的回答

It works for me (MATLAB 2012b):
rdir = [270,190,100,250,270,330,250,30,300,310,180,250,350,310,250,260,250,350,290,220,340,250] /180 *pi();
h = rose(rdir);
x = get(h, 'XData');
y = get(h, 'YData');
p = patch(x, y, 'r') ;
view(90,270);
Otherwise you could use the function given here:

2 个评论

I have 2016a - the basic function no longer works for me... The rose2.m file seems to do the trick though! Thanks!
@Arjan Reesink: it seems that there has been a change in the code, and the nodes are returned in a different order. You might be able to sort them into the required order.
You should definitely make a bug report about this new behavior:

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by