
function hline( y, color )

%HLINE	Add horizontal line to the current figure.
%	HLINE( y, color [blue] ) Adds a horizontal dashed line in the 
%	current graphic window, at the position defined by 'y',
%	The color of the line is defined by 'color', a three 
%	dimensional RBG vector, or single letter color definition.
%	For further information in 'color' format see 'set'
%	applied to changing the 'Color' property of a 'line' 
%	object. If the 'color' parameter is ommited the default 
%	line color is blue. 
%	This function asumes the axis dimensions are already adjusted.
%
%	See VLINE.


if( nargin < 1), y = 0;, end
if( nargin < 2), color = [0 0 1];, end

wasHold= ishold;
A= axis;

hold on
h = plot([A(1) A(2)],[y y],'b:');
set( h, 'Color', color )

if (~wasHold), hold off, end
