@@ -438,7 +438,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
438438 )
439439 ax .add_patch (self .track )
440440 self .poly = ax .axhspan (valmin , valinit , .25 , .75 , ** kwargs )
441- self .hline = ax .axhline (valinit , .25 , .75 , color = initcolor , lw = 1 )
441+ self .hline = ax .axhline (valinit , .15 , .85 , color = initcolor , lw = 1 )
442442 handleXY = [[0.5 ], [valinit ]]
443443 else :
444444 self .track = Rectangle (
@@ -448,7 +448,12 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
448448 )
449449 ax .add_patch (self .track )
450450 self .poly = ax .axvspan (valmin , valinit , .25 , .75 , ** kwargs )
451- self .vline = ax .axvline (valinit , .25 , .75 , color = initcolor , lw = 1 )
451+ # These asymmetric limits (.2, .9) minimize the asymmetry
452+ # above and below the *poly* when rendered to pixels.
453+ # This seems to be different for Horizontal and Vertical lines.
454+ # For discussion see:
455+ # https://github.com/matplotlib/matplotlib/pull/19265
456+ self .vline = ax .axvline (valinit , .2 , .9 , color = initcolor , lw = 1 )
452457 handleXY = [[valinit ], [0.5 ]]
453458 self ._handle , = ax .plot (
454459 * handleXY ,
0 commit comments