@@ -61,11 +61,18 @@ def __init__(
6161
6262 rects: list of tuples or arrays
6363 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.
6568
6669 extents: list of tuples or arrays
6770 list of extents (xmin, xmax, ymin, ymax) that define the subplots.
6871 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+
6976 If both ``rects`` and ``extents`` are provided, then ``rects`` takes precedence over ``extents``, i.e.
7077 ``extents`` is ignored when ``rects`` are also provided.
7178
@@ -146,7 +153,7 @@ def __init__(
146153 subplot_names = np .asarray (names ).flatten ()
147154 if subplot_names .size != n_subplots :
148155 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 } "
150157 )
151158 else :
152159 if layout_mode == "grid" :
@@ -206,7 +213,7 @@ def __init__(
206213 if not subplot_controllers .size == n_subplots :
207214 raise ValueError (
208215 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"
210217 ) from None
211218
212219 for index in range (n_subplots ):
@@ -278,7 +285,7 @@ def __init__(
278285
279286 if controller_ids .size != n_subplots :
280287 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 } "
282289 )
283290
284291 if controller_types is None :
0 commit comments