function []=annoline(ax,str,ltype,pos)
%	function annoline(ax,str,ltype,pos)
%	Annotates plot line type in the corners of the plot.
%	  ax=    axis limits { ax=axis; }.
%	  str=   text to be annotated on plot { can be an array of text }.
%	  ltype= line types { text array with line in the rows and linetype
%	         in the columns}.
%	  pos=   position {'ll', 'lr', 'ul', 'ur'}.

wth=(ax(2)-ax(1));
ht= (ax(4)-ax(3));
lht= ht/30;
lwth= wth /55;

[n lt]=size(str);

if pos == 'll',
  x= ax(1) + wth / 20 + 4 * lwth;
  y= ax(3) + ht / 20;
  ad=+1;
elseif pos == 'ul',
  x= ax(1) + wth / 20 + 4 * lwth;
  y= ax(4) - ht / 20 - lht;
  ad=-1;
elseif pos == 'lr',
  x= ax(2) - wth / 20 -lwth*lt;
  y= ax(3) + ht / 20;
  ad=+1;
elseif pos == 'ur',
  x= ax(2) - wth / 20 -lwth*lt;
  y= ax(4) - ht / 20 - lht;
  ad=-1;
end;

for i=1:n,
  y= y + (ad*lht*1.5*(i-1));
  xs= x - 4 * lwth;
  ys= y + lht*.5;
  xe= xs + lwth*3;
  plot([xs xe],[ys ys],ltype(i,:));
  text(x,y,str(i,:));
end;
