Pie Chart Percentages Of Each Section
Mostra commenti meno recenti
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 Commenti
Geoff Hayes
il 7 Mar 2016
Jack - there is no attachment. Once you have chosen the file, please press the Attach File button.
Ogen
il 7 Mar 2016
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Title in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!