我注意到有时,当我使用函数bar()或hist()绘制条形图时,绘制的条形图没有边框。他们看起来不太高兴,我更喜欢他们之间的边界或一点空间。 该图显示了我现在得到的结果,绘制了三个不同的数据集。第三张图放大以显示条之间的空间不足。 为什么有时酒吧或酒吧的酒吧没有边界?
我到那里,这与条形函数中'histc'参数有关。如果没有histc参数,小节之间会有一些空格,但是小节将以边的值为中心,而我希望边的值是每个小节的EDGES。
这是(相关部分),我使用的代码:
[...]
if edges==0
%these following lines are used to take the min and max of the three dataset
maxx=max(cellfun(@max, reshape(data,1,size(data,1)*size(data,2))));
minn=min(cellfun(@min, reshape(data,1,size(data,1)*size(data,2))));
edges=minn:binW:maxx+binW;
end
[...]
y{k}=histc(data{r,c}, edges);
bar(edges,y{k} , 'histc');
[...]