Pie Chart overlapping Labels
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Guys need help pleas,
I have some issues with pie chart. 1. The labels are very close to each other 2. the numbers that less than 1% like 0.02% will show as <1%
Also is there any way to write the percentage under the text and can I set the pie color to be ranged between black and white.
The code is
clear all clc X=[ 20 300 8 120 960 120 180 60 2400 60 320]; explode=[ 0 0 0 0 0 0 0 0 0 0 0]; h=pie(X,explode); colormap jet textObjs = findobj(h,'Type','text'); oldStr = get(textObjs,{'String'}); val = get(textObjs,{'Extent'}); oldExt = cat(1,val{:}); Names = {'Plastic material';'Pump ';'rube-base unit'.... ;'composite tank';'Crank-Shaft digested';'Steel PSA unit';'Turbines compressor Comp1';'Macerator '.... ;'Turbines compressor Comp2';'HeatingCoile storage facility ';'Auxiliary loads'};
newStr = strcat(Names,oldStr);
set(textObjs,{'String'},newStr);
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Pie Charts dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!