Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MatLab:历史褪色颜色取决于大小_Matlab_Colors_Histogram - Fatal编程技术网

MatLab:历史褪色颜色取决于大小

MatLab:历史褪色颜色取决于大小,matlab,colors,histogram,Matlab,Colors,Histogram,是否可以像hist3绘图一样使hist绘图的条形图褪色(参见下面的屏幕截图) 使用hist3扭曲1D数据: y=randn(1,1e2); bins = 10; hist3([y(:) y(:)],[1 bins]); view(90,0) set(gcf,'renderer','opengl'); set(get(gca,'child'),'FaceColor','interp','CDataMode','auto'); 编辑:要规范化直方图,只需根据numel(y)重新缩放标签,这意味

是否可以像hist3绘图一样使hist绘图的条形图褪色(参见下面的屏幕截图)


使用
hist3
扭曲1D数据:

y=randn(1,1e2);
bins = 10;
hist3([y(:) y(:)],[1 bins]);
view(90,0)
set(gcf,'renderer','opengl');
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');


编辑:要规范化直方图,只需根据
numel(y)
重新缩放标签,这意味着添加以下行:

set(gca,'ZTickLabel',str2num(get(gca,'ZTickLabel'))/numel(y));

真棒的黑客!非常感谢。还有一个问题:我需要标准化直方图。我使用[f,x]=hist(y(:),bins)来实现这一点;对于i=1:numel(f(1,:))对于j=1:numel(f(:,i))f(j,i)=f(j,i)/numel(y);端杆3(x,f);但是,您的解决方案不适用于bar3()。有解决办法吗?