File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
doc/api/next_api_changes/deprecations Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ ``Axis.get_label ``
2
+ ~~~~~~~~~~~~~~~~~~
3
+ `.Artist.get_label ` is reserved for legend labels. `.Axis.get_label ` had overwritten
4
+ this, providing the axis label `.Text ` instance. `.Axis.get_label ` will raise a
5
+ RuntimeError in the future. If you want the axis label `.Text ` instance, use the
6
+ property `.Axis.label ` instead.
Original file line number Diff line number Diff line change @@ -1442,6 +1442,15 @@ def get_gridlines(self):
1442
1442
return cbook .silent_list ('Line2D gridline' ,
1443
1443
[tick .gridline for tick in ticks ])
1444
1444
1445
+ def set_label (self , s ):
1446
+ """Not supported. Raises RuntimeError."""
1447
+ raise RuntimeError (
1448
+ "A legend label cannot be assigned to an Axis. Did you mean to "
1449
+ "set the axis label via set_label_text()?" )
1450
+
1451
+ @_api .deprecated ("3.10" , message = "Use the property 'Axis.label' instead" )
1452
+ # Note: After the deprecation, this should raise a RuntimeError; see
1453
+ # https://github.com/matplotlib/matplotlib/issues/27971#issuecomment-2016955731
1445
1454
def get_label (self ):
1446
1455
"""Return the axis label as a Text instance."""
1447
1456
return self .label
You can’t perform that action at this time.
0 commit comments