Pie Chart Percentages Of Each Section
이전 댓글 표시
Hello everyone I have plotted a pie chart of blast energy, thermal energy and nuclear radiation (see attachment). I want to display the percentage each specific section contributes to the overall energy (% each section of pie contributes to whole pie). Any help to edit the code to this would be greatly appreciated. Thanks.
if true
% code
kt = 'Please enter the yield in kilotonnes you wish to test: ';
kt = input(kt);
Ktjoules=(1*10^12);
TotalEnergy=kt*Ktjoules;
Blastenergy=(kt*Ktjoules)/(100)*(50);
ThermalEnergy=(kt*Ktjoules)/(100)*(35);
NuclearRadiation=(kt*Ktjoules)/(100)*(15);
title('Graph to show Blast Engergy, Thermal Energy and Nuclear Radiation in KiloTonnes')
x = [Blastenergy, ThermalEnergy, NuclearRadiation];
labels = {'Blast Energy','Thermal Energy','Nuclear Radiation'};
figure
pie3(x,labels)
view([-65, 35])
end
댓글 수: 2
Geoff Hayes
2016년 3월 7일
Jack - there is no attachment. Once you have chosen the file, please press the Attach File button.
Ogen
2016년 3월 7일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!