@@ -99,13 +99,14 @@ def __init__(self, fig,
9999 Whether all axes of a column share their x-axis.
100100 share_y : bool, default: True
101101 Whether all axes of a row share their y-axis.
102- label_mode : {"L", "1", "all"}, default: "L"
102+ label_mode : {"L", "1", "all", "keep" }, default: "L"
103103 Determines which axes will get tick labels:
104104
105105 - "L": All axes on the left column get vertical tick labels;
106106 all axes on the bottom row get horizontal tick labels.
107107 - "1": Only the bottom left axes is labelled.
108- - "all": all axes are labelled.
108+ - "all": All axes are labelled.
109+ - "keep": Do not do anything.
109110
110111 axes_class : subclass of `matplotlib.axes.Axes`, default: None
111112 aspect : bool, default: False
@@ -258,13 +259,14 @@ def set_label_mode(self, mode):
258259
259260 Parameters
260261 ----------
261- mode : {"L", "1", "all"}
262+ mode : {"L", "1", "all", "keep" }
262263 The label mode:
263264
264265 - "L": All axes on the left column get vertical tick labels;
265266 all axes on the bottom row get horizontal tick labels.
266267 - "1": Only the bottom left axes is labelled.
267- - "all": all axes are labelled.
268+ - "all": All axes are labelled.
269+ - "keep": Do not do anything.
268270 """
269271 if mode == "all" :
270272 for ax in self .axes_all :
@@ -292,6 +294,16 @@ def set_label_mode(self, mode):
292294
293295 ax = self .axes_llc
294296 _tick_only (ax , bottom_on = False , left_on = False )
297+ else :
298+ # Use _api.check_in_list at the top of the method when deprecation
299+ # period expires
300+ if mode != 'keep' :
301+ _api .warn_deprecated (
302+ '3.7' , name = "Grid label_mode" ,
303+ message = 'Passing a non-defined label_mode is deprecated '
304+ 'since %(since)s and will become an error '
305+ '%(removal)s. To silence this warning, pass '
306+ '"keep", which gives the same behaviour.' )
295307
296308 def get_divider (self ):
297309 return self ._divider
0 commit comments