Pie Chart overlapping Labels

3 次查看(过去 30 天)
Abdulaziz
Abdulaziz 2013-6-5
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 个)

类别

Help CenterFile Exchange 中查找有关 Pie Charts 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by