8000 Merge pull request #21520 from anntzer/mid · matplotlib/matplotlib@c0fc781 · GitHub
[go: up one dir, main page]

Skip to content

Commit c0fc781

Browse files
authored
Merge pull request #21520 from anntzer/mid
Shorten some inset_locator docstrings.
2 parents b22c1c9 + 903f64e commit c0fc781

File tree

1 file changed

+12
-69
lines changed

1 file changed

+12
-69
lines changed

lib/mpl_toolkits/axes_grid1/inset_locator.py

Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -168,24 +168,8 @@ class BboxConnector(Patch):
168168
@staticmethod
169169
def get_bbox_edge_pos(bbox, loc):
170170
"""
171-
Helper function to obtain the location of a corner of a bbox
172-
173-
Parameters
174-
----------
175-
bbox : `matplotlib.transforms.Bbox`
176-
177-
loc : {1, 2, 3, 4}
178-
Corner of *bbox*. Valid values are::
179-
180-
'upper right' : 1,
181-
'upper left' : 2,
182-
'lower left' : 3,
183-
'lower right' : 4
184-
185-
Returns
186-
-------
187-
x, y : float
188-
Coordinates of the corner specified by *loc*.
171+
Return the ``(x, y)`` coordinates of corner *loc* of *bbox*; parameters
172+
behave as documented for the `.BboxConnector` constructor.
189173
"""
190174
x0, y0, x1, y1 = bbox.extents
191175
if loc == 1:
@@ -200,35 +184,9 @@ def get_bbox_edge_pos(bbox, loc):
200184
@staticmethod
201185
def connect_bbox(bbox1, bbox2, loc1, loc2=None):
202186
"""
203-
Helper function to obtain a Path from one bbox to another.
204-
205-
Parameters
206-
----------
207-
bbox1, bbox2 : `matplotlib.transforms.Bbox`
208-
Bounding boxes to connect.
209-
210-
loc1 : {1, 2, 3, 4}
211-
Corner of *bbox1* to use. Valid values are::
212-
213-
'upper right' : 1,
214-
'upper left' : 2,
215-
'lower left' : 3,
216-
'lower right' : 4
217-
218-
loc2 : {1, 2, 3, 4}, optional
219-
Corner of *bbox2* to use. If None, defaults to *loc1*.
220-
Valid values are::
221-
222-
'upper right' : 1,
223-
'upper left' : 2,
224-
'lower left' : 3,
225-
'lower right' : 4
226-
227-
Returns
228-
-------
229-
path : `matplotlib.path.Path`
230-
A line segment from the *loc1* corner of *bbox1* to the *loc2*
231-
corner of *bbox2*.
187+
Construct a `.Path` connecting corner *loc1* of *bbox1* to corner
188+
*loc2* of *bbox2*, where parameters behave as documented as for the
189+
`.BboxConnector` constructor.
232190
"""
233191
if isinstance(bbox1, Rectangle):
234192
bbox1 = TransformedBbox(Bbox.unit(), bbox1.get_transform())
@@ -250,22 +208,15 @@ def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
250208
bbox1, bbox2 : `matplotlib.transforms.Bbox`
251209
Bounding boxes to connect.
252210
253-
loc1 : {1, 2, 3, 4}
254-
Corner of *bbox1* to draw the line. Valid values are::
211+
loc1, loc2 : {1, 2, 3, 4}
212+
Corner of *bbox1* and *bbox2* to draw the line. Valid values are::
255213
256214
'upper right' : 1,
257215
'upper left' : 2,
258216
'lower left' : 3,
259217
'lower right' : 4
260218
261-
loc2 : {1, 2, 3, 4}, optional
262-
Corner of *bbox2* to draw the line. If None, defaults to *loc1*.
263-
Valid values are::
264-
265-
'upper right' : 1,
266-
'upper left' : 2,
267-
'lower left' : 3,
268-
'lower right' : 4
219+
*loc2* is optional and defaults to *loc1*.
269220
270221
**kwargs
271222
Patch properties for the line drawn. Valid arguments include:
@@ -308,18 +259,10 @@ def __init__(self, bbox1, bbox2, loc1a, loc2a, loc1b, loc2b, **kwargs):
308259
bbox1, bbox2 : `matplotlib.transforms.Bbox`
309260
Bounding boxes to connect.
310261
311-
loc1a, loc2a : {1, 2, 3, 4}
312-
Corners of *bbox1* and *bbox2* to draw the first line.
313-
Valid values are::
314-
315-
'upper right' : 1,
316-
'upper left' : 2,
317-
'lower left' : 3,
318-
'lower right' : 4
319-
320-
loc1b, loc2b : {1, 2, 3, 4}
321-
Corners of *bbox1* and *bbox2* to draw the second line.
322-
Valid values are::
262+
loc1a, loc2a, loc1b, loc2b : {1, 2, 3, 4}
263+
The first line connects corners *loc1a* of *bbox1* and *loc2a* of
264+
*bbox2*; the second line connects corners *loc1b* of *bbox1* and
265+
*loc2b* of *bbox2*. Valid values are::
323266
324267
'upper right' : 1,
325268
'upper left' : 2,

0 commit comments

Comments
 (0)
0