% Example code to plot pixel values in a color cube. % Note1: mask is a binary image, in case we only care about some of the % pixels. Xs, Ys, Zs are images with the same size as the mask. % Note2: Change 'rx' and use "hold on" to plot values, expressed in the % same color-space, for different objects in the same figure. index = find(mask); plot3( Xs(index), Ys(index), Zs(index), 'rx' ); axis([0 1 0 1 0 1] ); axis on set(get(gca,'XLabel'),'String','Red axis'); set(get(gca,'YLabel'),'String','Green axis'); set(get(gca,'ZLabel'),'String','Blue axis'); set(gca,'box','on') set(gca,'XGrid','on') set(gca,'YGrid','on') set(gca,'ZGrid','on')