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);

 Accepted Answer

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 Comments

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:

Sign in to comment.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!