@@ -1900,7 +1900,7 @@ def in_axes(self, xwin, ywin):
19001900 'return True is the point xwin, ywin (display coords) are in the Axes'
19011901 return self .bbox .contains (xwin , ywin )
19021902
1903- def hlines (self , y , xmin , xmax , fmt = 'k-' ):
1903+ def hlines (self , y , xmin , xmax , fmt = 'k-' , ** kwargs ):
19041904 """
19051905 HLINES(y, xmin, xmax, fmt='k-')
19061906
@@ -1909,11 +1909,18 @@ def hlines(self, y, xmin, xmax, fmt='k-'):
19091909 respective values are constant, else the widths of the lines are
19101910 determined by xmin and xmax
19111911
1912+ fmt is a plot format string, eg 'g--'
1913+
1914+ kwargs are matplotlib.lines.Line2D kwargs
1915+
19121916 Returns a list of line instances that were added
19131917 """
19141918 linestyle , marker , color = _process_plot_format (fmt )
19151919
1916- # todo: fix me for y is scalar and xmin and xmax are iterable
1920+
1921+ if not iterable (y ): y = [y ]
1922+ if not iterable (xmin ): xmin = [xmin ]
1923+ if not iterable (xmax ): xmax = [xmax ]
19171924 y = asarray (y )
19181925 xmin = asarray (xmin )
19191926 xmax = asarray (xmax )
@@ -1933,6 +1940,7 @@ def hlines(self, y, xmin, xmax, fmt='k-'):
19331940 line = Line2D (
19341941 [thisMin , thisMax ], [thisY , thisY ],
19351942 color = color , linestyle = linestyle , marker = marker ,
1943+ ** kwargs
19361944 )
19371945 self .add_line ( line )
19381946 lines .append (line )
@@ -3562,7 +3570,7 @@ def toggle_log_lineary(self):
35623570 if funcy == LOG10 : self .set_yscale ('linear' )
35633571 elif funcy == IDENTITY : self .set_yscale ('log' )
35643572
3565- def vlines (self , x , ymin , ymax , color = 'k' ):
3573+ def vlines (self , x , ymin , ymax , fmt = 'k-' , ** kwargs ):
35663574 """
35673575 VLINES(x, ymin, ymax, color='k')
35683576
@@ -3571,8 +3579,19 @@ def vlines(self, x, ymin, ymax, color='k'):
35713579 respective values are constant, else the heights of the lines are
35723580 determined by ymin and ymax
35733581
3582+
3583+ fmt is a plot format string, eg 'g--'
3584+
3585+ kwargs are matplotlib.lines.Line2D kwargs
3586+
35743587 Returns a list of lines that were added
35753588 """
3589+ linestyle , marker , color = _process_plot_format (fmt )
3590+
3591+
3592+ if not iterable (x ): x = [x ]
3593+ if not iterable (ymin ): ymin = [ymin ]
3594+ if not iterable (ymax ): ymax = [ymax ]
35763595 x = asarray (x )
35773596 ymin = asarray (ymin )
35783597 ymax = asarray (ymax )
@@ -3592,7 +3611,9 @@ def vlines(self, x, ymin, ymax, color='k'):
35923611 lines = []
35933612 for thisX , thisY in zip (x ,Y ):
35943613 line = Line2D (
3595- [thisX , thisX ], thisY , color = color , linestyle = '-' ,
3614+ [thisX , thisX ], thisY ,
3615+ color = color , linestyle = linestyle , marker = marker ,
3616+ ** kwargs
35963617 )
35973618 self .add_line (line )
35983619 lines .append (line )
0 commit comments