% point Steve Mann % % makes a single point on plot, as an x, +, or * sign, using the line low level % line command, rather than plot. % % avoids need to ``hold on'' % also runs faster than plot(x,y,'+') % % Examples: point(80,100,'*') % puts a * at location (80,100) % point(80,100) % puts a + (default symbol) function put_a_little_symbol_on_current_plot(x,y,S) % returns nothing if nargin < 3 S='+'; end%if v=axis; % need to know how many pixels to make it certain fraction of height h=abs(v(4)-v(3)); % height w=abs(v(2)-v(1)); % height diagsiz=sqrt(h^2+w^2); ptsiz=round(diagsiz*.01); if S=='x' X=[x-ptsiz,x+ptsiz]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % \ X=[x+ptsiz,x-ptsiz]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % / elseif S=='+' % e.g. assume S='+' if something else X=[x-ptsiz,x+ptsiz]; Y=[y,y]; line(X,Y) % - X=[x,x]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % | else%if e.g. assume S='*' if something else X=[x-ptsiz,x+ptsiz]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % \ X=[x+ptsiz,x-ptsiz]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % / X=[x-ptsiz,x+ptsiz]; Y=[y,y]; line(X,Y) % - X=[x,x]; Y=[y-ptsiz,y+ptsiz]; line(X,Y) % | end%if