@@ -438,7 +438,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
438
438
)
439
439
ax .add_patch (self .track )
440
440
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 )
442
442
handleXY = [[0.5 ], [valinit ]]
443
443
else :
444
444
self .track = Rectangle (
@@ -448,7 +448,12 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
448
448
)
449
449
ax .add_patch (self .track )
450
450
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 )
452
457
handleXY = [[valinit ], [0.5 ]]
453
458
self ._handle , = ax .plot (
454
459
* handleXY ,
0 commit comments