@@ -1247,25 +1247,27 @@ class BoundaryNorm(Normalize):
1247
1247
"""
1248
1248
def __init__ (self , boundaries , ncolors , clip = False ):
1249
1249
"""
1250
- *boundaries*
1251
- a monotonically increasing sequence
1252
- *ncolors*
1253
- number of colors in the colormap to be used
1254
-
1255
- If::
1256
-
1257
- b[i] <= v < b[i+1]
1250
+ Parameters
1251
+ ----------
1252
+ boundaries : sequence
1253
+ Monotonically increasing sequence of boundaries
1254
+ ncolors : int
1255
+ Number of colors in the colormap to be used
1256
+ clip : bool, optional
1257
+ If clip is *True*, out of range values are mapped to *0* if they
1258
+ are below *boundaries[0]* or mapped to *ncolors - 1* if they are
1259
+ above *boundaries[-1]*.
1260
+
1261
+ If clip is *False*, out of range values are mapped to *-1* if they
1262
+ are below *boundaries[0]* or mapped to *ncolors* if they are
1263
+ above *boundaries[-1]*. These are then converted to valid indices
1264
+ by :meth:`Colormap.__call__`.
1258
1265
1259
- then v is mapped to color j;
1266
+ Notes
1267
+ -----
1268
+ If :code:`b[i] <= v < b[i+1]` then v is mapped to color j;
1260
1269
as i varies from 0 to len(boundaries)-2,
1261
1270
j goes from 0 to ncolors-1.
1262
-
1263
- Out-of-range values are mapped
1264
- to -1 if low and ncolors if high; these are converted
1265
- to valid indices by
1266
- :meth:`Colormap.__call__` .
1267
- If clip == True, out-of-range values
1268
- are mapped to 0 if low and ncolors-1 if high.
1269
1271
"""
1270
1272
self .clip = clip
1271
1273
self .vmin = boundaries [0 ]
@@ -1304,6 +1306,13 @@ def __call__(self, value, clip=None):
1304
1306
return ret
1305
1307
1306
1308
def inverse (self , value ):
1309
+ """
1310
+ Raises
1311
+ ------
1312
+ ValueError
1313
+ BoundaryNorm is not invertible, so calling this method will always
1314
+ raise an error
1315
+ """
1307
1316
return ValueError ("BoundaryNorm is not invertible" )
1308
1317
1309
1318
0 commit comments