function h=plothist_bars(Map,Counts,varargin)
% plothist_bars - Plot histogram using bars.
%
% plothist_bars :: 
%    dmap(N)    ~'the bin map',
%    [[N]]      ~'the bin counts'
% -> handle.
%
% The width of the bars matches the width of the discretisation bins.
% The *area* of the bars (not the height) is proportional to bin counts.
% Any extra arguments are passed to FILL.

if isvector(Counts), Counts=Counts(:)'; end

x=bins(Map);
y=Counts./diff(x);

h=fill([x;flipud(x)],[zeros(2,size(y,2));y;y],1, ...
	'EdgeColor',get(gca,'XColor'),varargin{:});
caxis([0,2]);
