matlab bar3 函数生成的柱形图 的每个柱体的颜色 如何更改

matlab bar3 函数生成的柱形图 的每个柱体的颜色 如何更改,第1张

这个要用程序代码改。
代码如下:
M=rand(30,20);
figure
subplot(1,2,1)
h=bar3(M)
for n=1:numel(h)
cdata=get(h(n),'zdata');
set(h(n),'cdata',cdata,'facecolor','interp')
end
subplot(1,2,2)
h=bar3(M)
for n=1:numel(h)
cdata=get(h(n),'zdata');
cdata=repmat(max(cdata,[],2),1,4);
set(h(n),'cdata',cdata,'facecolor','flat')
end


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/13400561.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-29
下一篇 2023-07-29

发表评论

登录后才能评论

评论列表(0条)

保存