function retval=get_normalized_coords(x)
  x=x';
  pos=get(gca, "position")
  M=[pos(3)/diff(xlim()) 0; 0 pos(4)/diff(ylim())];
  b=[xlim()(1) ylim()(1)]';
  retval=M*(x-b)+[pos(1); pos(2)];
endfunction
