Skip to content

Commit 32641c7

Browse files
committed
Document what happens when ncolors > bins
1 parent 2b6699c commit 32641c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/colors.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ class BoundaryNorm(Normalize):
12461246
between integer and floating point.
12471247
"""
12481248
def __init__(self, boundaries, ncolors, clip=False):
1249-
"""
1249+
r"""
12501250
Parameters
12511251
----------
12521252
boundaries : sequence
@@ -1265,9 +1265,9 @@ def __init__(self, boundaries, ncolors, clip=False):
12651265
12661266
Notes
12671267
-----
1268-
If :code:`b[i] <= v < b[i+1]` then v is mapped to color j;
1269-
as i varies from 0 to len(boundaries)-2,
1270-
j goes from 0 to ncolors-1.
1268+
If :code:`b[i] <= v < b[i+1]` then v is mapped to
1269+
floor( :math:`\frac{n_{colors}- 1}{n_{bins} - 1} * i`), where nbins is
1270+
is ``len(boundaries) - 2``.
12711271
"""
12721272
self.clip = clip
12731273
self.vmin = boundaries[0]

0 commit comments

Comments
 (0)