When plotting a pie-chart with any one of the data values as zero and a user-defined colormap,unexpected colors are skipped. I also get a warning message
"Warning: Ignoring non-positive data in pie chart."
With first value as 0, it skips green(second value on colormap)
Dat = [0 10 20 40]t1col = [1 0 0]; %red
t2col = [0 1 0]; %green
t3col = [0 0 1]; %blue
t4col = [1 0 1]; %magenta
tilecolor = [t1col; t2col; t3col; t4col]; pie(Dat)colormap(tilecolor)
With second value as 0, it skips green again
dat = [5 0 20 40]t1col = [1 0 0]; %red t2col = [0 1 0]; %greent3col = [0 0 1]; %bluet4col = [1 0 1]; %magentatilecolor = [t1col; t2col; t3col; t4col]; pie(dat)colormap(tilecolor)
Best Answer