1
Matlabで3D棒グラフを作成しました。私は、各グループのために同じ色たい(例えば、S1 =青、S2 =緑色およびS3 =赤、以下のグラフを参照)Matlabのbar3プロットのグループの色を制御する方法
Iは、次のコード使用:任意の提案
Z = data;
Y = [1 300 600]; % The positions of bars along the y axis
h = bar3(Y,Z',0.05);
[nGroup, nBar] = size(Z);
nColors = size(get(gcf, 'colormap'), 1);
colorInd = randi(nColors, nBar, nGroup);
for i = 1:nGroup
c = get(h(i), 'CData');
color = repelem(repmat(colorInd(:, i), 1, 4), 6, 1);
set(h(i), 'CData', color);
end
set(gca, 'YTickLabel',
か?