フィルターのクリア

3d pie chart help

3 ビュー (過去 30 日間)
sam ham
sam ham 2016 年 11 月 7 日
回答済み: Walter Roberson 2016 年 11 月 7 日
Hi guys. So heres my situation. I have two sets of data in excel; one for white and one for red wine. The white wine has nearly 5000 sets of data points for alcohol percentage and the red wine has nearly 2000. I am suppose to compare the alcohol percentage of red wine to white wine using a 3d pie chart. But I cant seem to do it. Any help would be greatly appreciated!
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 11 月 7 日
How many slices are you expecting the pie chart to have? 7000?

サインインしてコメントする。

回答 (2 件)

KSSV
KSSV 2016 年 11 月 7 日
clc; clear all ;
x = [5000 2000];
figure
pie3(x)
doc pie3
  3 件のコメント
KSSV
KSSV 2016 年 11 月 7 日
You got to know what to use, read the documentation. Upload the data from excel file and use pie3.
Walter Roberson
Walter Roberson 2016 年 11 月 7 日
I really don't think the user wants 7000 slices. The user probably does, however, want the two groups to be colored differently.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2016 年 11 月 7 日
I would put it to you that you probably want to do the equivalent of histograming the wines by percentage alcohol, doing that in two different groups but with the same boundaries, and then presenting the information in a pie chart.
N_steps = 10;
combined_data = [red_levels(:); white_levels(:)];
level_breaks = linspace(min(combined_data), max(combined_data), N_steps);
red_counts = histcounts(red_levels, level_breaks);
red_counts = red_counts(:);
white_counts = histcounts(white_levels, level_breaks);
rev_white_counts = flipud( white_counts(:) );
red_labels = cellstr(num2str(level_breaks(:), '%2f'));
white_labels = flipud(red_labels);
labels = [red_labels; white_labels];
pie3( [red_counts(:); rev_white_counts)], labels)

カテゴリ

Help Center および File ExchangePie Charts についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by