Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccaf756

Browse files
committed
rename bkd -> track + change default color to lightgrey
1 parent c6e22ef commit ccaf756

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/matplotlib/widgets.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
330330
closedmin=True, closedmax=True, slidermin=None,
331331
slidermax=None, dragging=True, valstep=None,
332332
orientation='horizontal', *, initcolor='r',
333-
bkd_color='grey', handle_color_grabbed=None,
333+
track_color='lightgrey', handle_color_grabbed=None,
334334
handle_color_released='white', handle_edgecolor='.75',
335335
handle_size=10, **kwargs):
336336
"""
@@ -383,9 +383,9 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
383383
The color of the line at the *valinit* position. Set to ``'none'``
384384
for no line.
385385
386-
bkd_color : color, default: 'grey'
387-
The background color of the slider. The background is accesible for
388-
further styling via the *bkd* attribute.
386+
track_color : color, default: 'lightgrey'
387+
The color of the backgrond track. The track is accesible for
388+
further styling via the *track* attribute.
389389
390390
handle_color_grabbed : color or None, default: None
391391
The color of the circular slider handle when grabbed. If *None*
@@ -424,14 +424,14 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt=None,
424424
self.val = valinit
425425
self.valinit = valinit
426426
if orientation == 'vertical':
427-
self.bkd = Rectangle((.25, 0), .5, 1, transform=ax.transAxes, facecolor=bkd_color)
428-
ax.add_patch(self.bkd)
427+
self.track = Rectangle((.25, 0), .5, 1, transform=ax.transAxes, facecolor=track_color)
428+
ax.add_patch(self.track)
429429
self.poly = ax.axhspan(valmin, valinit, .25, .75, **kwargs)
430430
self.hline = ax.axhline(valinit, .25, .75, color=initcolor, lw=1)
431431
handleXY = [[0.5], [valinit]]
432432
else:
433-
self.bkd = Rectangle((0, .25), 1, .5, transform=ax.transAxes, facecolor=bkd_color)
434-
ax.add_patch(self.bkd)
433+
self.track = Rectangle((0, .25), 1, .5, transform=ax.transAxes, facecolor=track_color)
434+
ax.add_patch(self.track)
435435
self.poly = ax.axvspan(valmin, valinit, .25, .75, **kwargs)
436436
self.vline = ax.axvline(valinit, .25, .75, color=initcolor, lw=1)
437437
handleXY = [[valinit], [0.5]]
@@ -606,7 +606,7 @@ def __init__(
606606
dragging=True,
607607
valstep=None,
608608
orientation="horizontal",
609-
bkd_color='grey',
609+
track_color='lightgrey',
610610
handle_color_grabbed=None,
611611
handle_color_released='white',
612612
handle_edgecolor='.75',
@@ -651,9 +651,9 @@ def __init__(
651651
orientation : {'horizontal', 'vertical'}, default: 'horizontal'
652652
The orientation of the slider.
653653
654-
bkd_color : color, default: 'grey'
655-
The background color of the slider. The background is accesible for
656-
further styling via the *bkd* attribute.
654+
track_color : color, default: 'lightgrey'
655+
The color of the backgrond track. The track is accesible for
656+
further styling via the *track* attribute.
657657
658658
handle_color_grabbed : color or None, default: None
659659
The color of the circular slider handles when grabbed. If *None*
@@ -689,20 +689,20 @@ def __init__(
689689
self.val = valinit
690690
self.valinit = valinit
691691
if orientation == "vertical":
692-
self.bkd = Rectangle((.25, 0), .5, 2,
692+
self.track = Rectangle((.25, 0), .5, 2,
693693
transform=ax.transAxes,
694-
facecolor=bkd_color
694+
facecolor=track_color
695695
)
696-
ax.add_patch(self.bkd)
696+
ax.add_patch(self.track)
697697
self.poly = ax.axhspan(valinit[0], valinit[1], 0, 1, **kwargs)
698698
handleXY_1 = [.5, valinit[0]]
699699
handleXY_2 = [.5, valinit[1]]
700700
else:
701-
self.bkd = Rectangle((0, .25), 1, .5,
701+
self.track = Rectangle((0, .25), 1, .5,
702702
transform=ax.transAxes,
703-
facecolor=bkd_color
703+
facecolor=track_color
704704
)
705-
ax.add_patch(self.bkd)
705+
ax.add_patch(self.track)
706706
self.poly = ax.axvspan(valinit[0], valinit[1], 0, 1, **kwargs)
707707
handleXY_1 = [valinit[0], .5]
708708
handleXY_2 = [valinit[1], .5]

0 commit comments

Comments
 (0)