@@ -61,11 +61,18 @@ def __init__(
61
61
62
62
rects: list of tuples or arrays
63
63
list of rects (x, y, width, height) that define the subplots.
64
- rects can be defined in absolute pixels or as a fraction of the canvas
64
+ rects can be defined in absolute pixels or as a fraction of the canvas.
65
+ If width & height <= 1 the rect is assumed to be fractional.
66
+ Conversely, if width & height > 1 the rect is assumed to be in absolute pixels.
67
+ width & height must be > 0. Negative values are not allowed.
65
68
66
69
extents: list of tuples or arrays
67
70
list of extents (xmin, xmax, ymin, ymax) that define the subplots.
68
71
extents can be defined in absolute pixels or as a fraction of the canvas.
72
+ If xmax & ymax <= 1 the extent is assumed to be fractional.
73
+ Conversely, if xmax & ymax > 1 the extent is assumed to be in absolute pixels.
74
+ Negative values are not allowed. xmax - xmin & ymax - ymin must be > 0.
75
+
69
76
If both ``rects`` and ``extents`` are provided, then ``rects`` takes precedence over ``extents``, i.e.
70
77
``extents`` is ignored when ``rects`` are also provided.
71
78
@@ -146,7 +153,7 @@ def __init__(
146
153
subplot_names = np .asarray (names ).flatten ()
147
154
if subplot_names .size != n_subplots :
148
155
raise ValueError (
149
- "must provide same number of subplot `names` as specified by Figure ` shape` "
156
+ f "must provide same number of subplot `names` as specified by shape, extents, or rects: { n_subplots } "
150
157
)
151
158
else :
152
159
if layout_mode == "grid" :
@@ -206,7 +213,7 @@ def __init__(
206
213
if not subplot_controllers .size == n_subplots :
207
214
raise ValueError (
208
215
f"number of controllers passed must be the same as the number of subplots specified "
209
- f"by shape: { n_subplots } . You have passed: { subplot_controllers .size } controllers"
216
+ f"by shape, extents, or rects : { n_subplots } . You have passed: { subplot_controllers .size } controllers"
210
217
) from None
211
218
212
219
for index in range (n_subplots ):
@@ -278,7 +285,7 @@ def __init__(
278
285
279
286
if controller_ids .size != n_subplots :
280
287
raise ValueError (
281
- "Number of controller_ids does not match the number of subplots"
288
+ f "Number of controller_ids does not match the number of subplots: { n_subplots } "
282
289
)
283
290
284
291
if controller_types is None :
0 commit comments