MATLAB: Bar plot… problem with * marks

barhistc

I have a problem with bar ploting. This is the code and picture is in attachment
figure
c=histc(sondaza(:,i),e);
h=bar(e,c, 'histc');
set(h,'FaceColor','b'); hold on;
How remove blue *??

Best Answer

The stars are an odd peculiarity of the 'histc' option... I'm not sure what the original programmer's motivation was, but if your bin widths are not even, markers are placed along the x-axis at each bin edge. The handle to this line object isn't returned, so you'll have to handle-dive to get rid of them:
delete(findobj('marker', '*'));
I'd be curious to know where this convention came from... I use the 'histc' option with bar all the time, but it is an undocumented legacy option (and is implemented via barV6.m, which "is undocumented and may change in a future release"), so I too discovered the * behavior accidentally.