function [hp ht]=showpart(x,y,D,txt,box,varargin)

if(~exist('txt','var') || isempty(txt))
  txt=false;
end

if(~exist('box','var') || isempty(box))
  box=true;
end

rect=[min(x-D/2) max(x+D/2) min(y-D/2) max(y+D/2)];


N=length(x);

hp=zeros(1,N);

m=1;
for n=1:N;
  hp(m)=rectangle('position',[x(n)-D(n)/2 y(n)-D(n)/2 D(n)+eps D(n)+eps],'curvature',[1 1],varargin{:});
  m=m+1;
end;

axis('equal');
axis(rect);

if(txt)
  ht=text(x,y,num2str((1:N)'),'horizontalAlignment','center');
end

if(box)
  r2=[rect([1 3]) rect([2 4])-rect([1 3])];
  rectangle('position',r2);
end

end
