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

Skip to content

Commit c1a4dc9

Browse files
committed
Small axislines.Axes cleanups.
- Deprecate the "callable axes" API, which is not present anywhere else nor documented nor tested. - No need to set the transform on the GridlinesCollection; _set_artist_props takes care of that.
1 parent 266939f commit c1a4dc9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Callable axisartist Axes
2+
~~~~~~~~~~~~~~~~~~~~~~~~
3+
Calling an axisartit Axes to mean `.Axes.axis` is deprecated; explicitly call
4+
the method instead.

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def get_gridlines(self, which="major", axis="both"):
407407

408408
class Axes(maxes.Axes):
409409

410+
@_api.deprecated("3.8", alternative="ax.axis")
410411
def __call__(self, *args, **kwargs):
411412
return maxes.Axes.axis(self.axes, *args, **kwargs)
412413

@@ -440,7 +441,7 @@ def clear(self):
440441

441442
# Init gridlines before clear() as clear() calls grid().
442443
self.gridlines = gridlines = GridlinesCollection(
443-
[], transform=self.transData,
444+
[],
444445
colors=mpl.rcParams['grid.color'],
445446
linestyles=mpl.rcParams['grid.linestyle'],
446447
linewidths=mpl.rcParams['grid.linewidth'])

0 commit comments

Comments
 (0)