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