function siemens_hook(status)

p=get(gcf,'currentpoint');
c=get(gcf,'children');

%Convert the position to axes units and form there to a number of rules
pa=get(c(1),'position');
pf=get(gcf,'position');

rel_x = (p(1)/pf(3) - pa(1))/pa(3);
rg=get(c(1),'XLim');
dis_x = round(rel_x*(rg(2)-rg(1)))+rg(1);

params=get(gcf,'userdata');

if params.val~=dis_x,
	if ~isempty(params.obj),
		delete(params.obj(1));
		delete(params.obj(2));
		params.obj=[];
	end
	
	if (dis_x>=1) & (dis_x<=rg(2)),
		axes(c(2));
		params.obj(1)=plot(dis_x,params.e1(dis_x),'mo');
		
		axes(c(1));
		params.obj(2)=plot(dis_x,params.e2(dis_x),'mo');
		
		params.val = dis_x;
	else
		params.val = 0;
	end
end

set(gcf,'Userdata',params);
