How to plot Nightingale Rose Chart in Matlab

Hi all, I want to create a pie chart (Nightingale Rose Chart) Does anyone know how to do this?
TIM图片20190826150522.jpg
This pie chart is an example of what I would like to achieve.
Hopefully this makes it a bit clearer. Thanks in advance!

댓글 수: 1

David K.
David K. 2019년 8월 26일
It looks like polarhistogram is what you want. It looks like you will need to scale your data to be from 0 to 2pi and text can be put in with the text command. I am not sure how you could do color but it may be possible.

댓글을 달려면 로그인하십시오.

 채택된 답변

Raunak Gupta
Raunak Gupta 2019년 8월 29일

1 개 추천

Hi,
In my understanding the pie charts you are trying to plot can be drawn using polarhistogram. From the figure you have attached I can see there are 6 bins in the polarhistogram object.
I am assuming you have the background figure that is similar to a map. So, you can generate the individual polarhistogram using below code:
close all
p = polaraxes;
polarhistogram(p,'BinEdges', linspace(0,2*pi,7),'BinCounts',[0.3 0.1 0.2 0.8 0.57 0.7]);
p.RLim = [0 1];
p.ThetaTick = [];
p.RTickLabel = {};
The ‘BinCounts’ parameter can be changed based on the values you have in each category.
For Adding Multiple polarhistogram you may use App Designer. In that you can add multiple Polar Axes on top of the figure that contains the map. For drawing polarhistogram you need to have the positions of the axes.
Currently for plotting Nightingale Rose Chart directly with a function is not supported. You may use App Designer for plotting separately every individual object.
You may refer to following for using App Designer:

추가 답변 (2개)

suling yin
suling yin 2019년 9월 3일
편집: suling yin 2019년 9월 3일

0 개 추천

Thanks Raunak Gupta ,
One more question: how can I set different color for each category in your example above.
Regards,

댓글 수: 3

Hi,
You can plot seperate categories as below but for legend you have to enter them as a text field in App Designer. For putting seperate color without plotting seperate part is there in histogram but not in polarhistogram. So , you can use below for plotting one pie chart.
close all
p = polaraxes;
polarhistogram(p,'BinEdges',[0 pi/3],'BinCounts',[0.56]);
hold on
polarhistogram(p,'BinEdges',[pi/3 2*pi/3],'BinCounts',[0.65]);
polarhistogram(p,'BinEdges',[2*pi/3 pi],'BinCounts',[0.35]);
polarhistogram(p,'BinEdges',[pi 4*pi/3],'BinCounts',[0.8]);
polarhistogram(p,'BinEdges',[4*pi/3 5*pi/3],'BinCounts',[0.57]);
polarhistogram(p,'BinEdges',[5*pi/3 2*pi],'BinCounts',[0.7]);
p.RLim = [0 1];
p.ThetaTick = [];
p.RTickLabel = {};
hold off
Hope this helps.
suling yin
suling yin 2019년 9월 3일
It is great help.
And can I specify the color for each categories ?
Raunak Gupta
Raunak Gupta 2019년 12월 16일
Hi,
While plotting a single polarhistogram you may mention the color with 'FaceColor' option with predefined color string or RGB triplets.
Hope it helps.

댓글을 달려면 로그인하십시오.

suling yin
suling yin 2019년 12월 14일

0 개 추천

It is great help.
And can I specify the color for each categories ?

카테고리

도움말 센터File Exchange에서 Polar Plots에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2019년 8월 26일

댓글:

2019년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by