@@ -168,24 +168,8 @@ class BboxConnector(Patch):
168
168
@staticmethod
169
169
def get_bbox_edge_pos (bbox , loc ):
170
170
"""
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.
189
173
"""
190
174
x0 , y0 , x1 , y1 = bbox .extents
191
175
if loc == 1 :
@@ -200,35 +184,9 @@ def get_bbox_edge_pos(bbox, loc):
200
184
@staticmethod
201
185
def connect_bbox (bbox1 , bbox2 , loc1 , loc2 = None ):
202
186
"""
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.
232
190
"""
233
191
if isinstance (bbox1 , Rectangle ):
234
192
bbox1 = TransformedBbox (Bbox .unit (), bbox1 .get_transform ())
@@ -250,22 +208,15 @@ def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
250
208
bbox1, bbox2 : `matplotlib.transforms.Bbox`
251
209
Bounding boxes to connect.
252
210
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::
255
213
256
214
'upper right' : 1,
257
215
'upper left' : 2,
258
216
'lower left' : 3,
259
217
'lower right' : 4
260
218
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*.
269
220
270
221
**kwargs
271
222
Patch properties for the line drawn. Valid arguments include:
@@ -308,18 +259,10 @@ def __init__(self, bbox1, bbox2, loc1a, loc2a, loc1b, loc2b, **kwargs):
308
259
bbox1, bbox2 : `matplotlib.transforms.Bbox`
309
260
Bounding boxes to connect.
310
261
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::
323
266
324
267
'upper right' : 1,
325
268
'upper left' : 2,
0 commit comments