@@ -1214,8 +1214,8 @@ def __init__(self, vmin=None, vmax=None, clip=False):
1214
1214
are mapped to 0 or 1, whichever is closer, and masked values are
1215
1215
set to 1. If ``False`` masked values remain masked.
1216
1216
1217
- Clipping silently defeats the purpose of setting the over, under,
1218
- and masked colors in a colormap, so it is likely to lead to
1217
+ Clipping silently defeats the purpose of setting the over and
1218
+ under colors in a colormap, so it is likely to lead to
1219
1219
surprises; therefore the default is ``clip=False``.
1220
1220
1221
1221
Notes
@@ -1775,8 +1775,8 @@ def forward(values: array-like) -> array-like
1775
1775
are mapped to 0 or 1, whichever is closer, and masked values are
1776
1776
set to 1. If ``False`` masked values remain masked.
1777
1777
1778
- Clipping silently defeats the purpose of setting the over, under,
1779
- and masked colors in a colormap, so it is likely to lead to
1778
+ Clipping silently defeats the purpose of setting the over and
1779
+ under colors in a colormap, so it is likely to lead to
1780
1780
surprises; therefore the default is ``clip=False``.
1781
1781
"""
1782
1782
@@ -1858,9 +1858,34 @@ def linear_width(self, value):
1858
1858
1859
1859
1860
1860
class PowerNorm (Normalize ):
1861
- """
1861
+ r """
1862
1862
Linearly map a given value to the 0-1 range and then apply
1863
1863
a power-law normalization over that range.
1864
+
1865
+ Parameters
1866
+ ----------
1867
+ gamma : float
1868
+ Power law exponent.
1869
+ vmin, vmax : float or None
1870
+ If *vmin* and/or *vmax* is not given, they are initialized from the
1871
+ minimum and maximum value, respectively, of the first input
1872
+ processed; i.e., ``__call__(A)`` calls ``autoscale_None(A)``.
1873
+ clip : bool, default: False
1874
+ If ``True`` values falling outside the range ``[vmin, vmax]``,
1875
+ are mapped to 0 or 1, whichever is closer, and masked values
1876
+ remain masked.
1877
+
1878
+ Clipping silently defeats the purpose of setting the over and under
1879
+ colors, so it is likely to lead to surprises; therefore the default
1880
+ is ``clip=False``.
1881
+
1882
+ Notes
1883
+ -----
1884
+ The normalization formula is
1885
+
1886
+ .. math::
1887
+
1888
+ \left ( \frac{x - v_{min}}{v_{max} - v_{min}} \right )^{\gamma}
1864
1889
"""
1865
1890
def __init__ (self , gamma , vmin = None , vmax = None , clip = False ):
1866
1891
super ().__init__ (vmin , vmax , clip )
0 commit comments