Skip to content

Commit 8bb3100

Browse files
authored
Merge pull request matplotlib#25729 from anntzer/ghc
Cleanup GridHelperCurveLinear/GridFinder.
2 parents d256e47 + 1ca7240 commit 8bb3100

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

Diff for: lib/mpl_toolkits/axisartist/grid_finder.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,18 @@ def inverted(self):
121121

122122

123123
class GridFinder:
124+
"""
125+
Internal helper for `~.grid_helper_curvelinear.GridHelperCurveLinear`, with
126+
the same constructor parameters; should not be directly instantiated.
127+
"""
128+
124129
def __init__(self,
125130
transform,
126131
extreme_finder=None,
127132
grid_locator1=None,
128133
grid_locator2=None,
129134
tick_formatter1=None,
130135
tick_formatter2=None):
131-
"""
132-
transform : transform from the image coordinate (which will be
133-
the transData of the axes to the world coordinate).
134-
135-
or transform = (transform_xy, inv_transform_xy)
136-
137-
locator1, locator2 : grid locator for 1st and 2nd axis.
138-
"""
139136
if extreme_finder is None:
140137
extreme_finder = ExtremeFinderSimple(20, 20)
141138
if grid_locator1 is None:

Diff for: lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

+18-9
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,27 @@ def __init__(self, aux_trans,
234234
tick_formatter1=None,
235235
tick_formatter2=None):
236236
"""
237-
aux_trans : a transform from the source (curved) coordinate to
238-
target (rectilinear) coordinate. An instance of MPL's Transform
239-
(inverse transform should be defined) or a tuple of two callable
240-
objects which defines the transform and its inverse. The callables
241-
need take two arguments of array of source coordinates and
242-
should return two target coordinates.
243-
244-
e.g., ``x2, y2 = trans(x1, y1)``
237+
Parameters
238+
----------
239+
aux_trans : `.Transform` or tuple[Callable, Callable]
240+
The transform from curved coordinates to rectilinear coordinate:
241+
either a `.Transform` instance (which provides also its inverse),
242+
or a pair of callables ``(trans, inv_trans)`` that define the
243+
transform and its inverse. The callables should have signature::
244+
245+
x_rect, y_rect = trans(x_curved, y_curved)
246+
x_curved, y_curved = inv_trans(x_rect, y_rect)
247+
248+
extreme_finder
249+
250+
grid_locator1, grid_locator2
251+
Grid locators for each axis.
252+
253+
tick_formatter1, tick_formatter2
254+
Tick formatters for each axis.
245255
"""
246256
super().__init__()
247257
self._grid_info = None
248-
self._aux_trans = aux_trans
249258
self.grid_finder = GridFinder(aux_trans,
250259
extreme_finder,
251260
grid_locator1,

0 commit comments

Comments
 (0)