E572 set_axis_bgcolor -> set_facecolor per request of @tacaswell · matplotlib/matplotlib@bde1040 · GitHub
[go: up one dir, main page]

Skip to content

Commit bde1040

Browse files
smithspfariza
authored andcommitted
set_axis_bgcolor -> set_facecolor per request of @tacaswell
1 parent 1c86e82 commit bde1040

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,14 +2606,14 @@ def _get_uniform_gridstate(ticks):
26062606
# keys in list 'all' enables all axes (default key 'a'),
26072607
# otherwise if key is a number only enable this particular axes
26082608
# if it was the axes, where the event was raised
2609-
if not (event.key in all):
2609+
if not (event.key in all_keys):
26102610
n = int(event.key) - 1
26112611
for i, a in enumerate(canvas.figure.get_axes()):
26122612
# consider axes, in which the event was raised
26132613
# FIXME: Why only this axes?
26142614
if event.x is not None and event.y is not None \
26152615
and a.in_axes(event):
2616-
if event.key in all:
2616+
if event.key in all_keys:
26172617
a.set_navigate(True)
26182618
else:
26192619
a.set_navigate(i == n)

lib/matplotlib/widgets.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def __init__(self, ax, label, initial='',
675675
676676
hovercolor : color
677677
The color of the box when the mouse is over it
678-
678+
679679
label_pad : float
680680
the distance between the label and the right side of the textbox
681681
"""
@@ -717,7 +717,7 @@ def __init__(self, ax, label, initial='',
717717
self.connect_event('key_press_event', self._keypress)
718718
self.connect_event('resize_event', self._resize)
719719
ax.set_navigate(False)
720-
ax.set_axis_bgcolor(color)
720+
ax.set_facecolor(color)
721721
ax.set_xticks([])
722722
ax.set_yticks([])
723723
self.color = color
@@ -808,9 +808,9 @@ def _keypress(self, event):
808808
if key == "enter":
809809
self._notify_submit_observers()
810810

811-
def set_val(self,val):
811+
def set_val(self, val):
812812
newval = str(val)
813-
if self.text==newval:
813+
if self.text == newval:
814814
return
815815
self.text = newval
816816
self.text_disp.remove()
@@ -825,8 +825,8 @@ def _notify_change_observers(self):
825825

826826
def begin_typing(self, x):
827827
self.capturekeystrokes = True
828-
#disable command keys so that the user can type without
829-
#command keys causing figure to be saved, etc
828+
# disable command keys so that the user can type without
829+
# command keys causing figure to be saved, etc
830830
self.reset_params = {}
831831
for key in self.params_to_disable:
832832
self.reset_params[key] = rcParams[key]
@@ -838,8 +838,8 @@ def stop_typing(self):
838838
# user's code, we only want to call it once we've already done
839839
# our cleanup.
840840
if self.capturekeystrokes:
841-
#since the user is no longer typing,
842-
#reactivate the standard command keys
841+
# since the user is no longer typing,
842+
# reactivate the standard command keys
843843
for key in self.params_to_disable:
844844
rcParams[key] = self.reset_params[key]
845845
notifysubmit = True
@@ -850,8 +850,8 @@ def stop_typing(self):
850850
self._notify_submit_observers()
851851

852852
def position_cursor(self, x):
853-
#now, we have to figure out where the cursor goes.
854-
#approximate it based on assuming all characters the same length
853+
# now, we have to figure out where the cursor goes.
854+
# approximate it based on assuming all characters the same length
855855
if len(self.text) == 0:
856856
self.cursor_index = 0
857857
else:
@@ -901,7 +901,7 @@ def _motion(self, event):
901901
else:
902902
c = self.color
903903
if c != self._lastcolor:
904-
self.ax.set_axis_bgcolor(c)
904+
self.ax.set_facecolor(c)
905905
self._lastcolor = c
906906
if self.drawon:
907907
self.ax.figure.canvas.draw()

0 commit comments

Comments
 (0)
0