Pie Chart overlapping Labels
3 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Pie Charts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!