Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document auto-init behavior of colors.Normalize and cm.ScalarMappable. #3628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweaks to colors.Normalize and cm.ScalarMappable docstrings.
modified:   cm.py in ScalarMappable.__init__
    "If not given or *None*," ==> "If *None*,"

modified:   colors.py in Normalize.__call__
    Removed this: "``norm.__call__(value) <==> norm(value)``"
    Mentioned that __call__ takes *value* and returns
        the normalized data.
  • Loading branch information
switham committed Oct 15, 2014
commit 038507120acbafa5bd96adcf555047f81d90c7ae
6 changes: 2 additions & 4 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,10 @@ def __init__(self, norm=None, cmap=None):
norm : :class:`matplotlib.colors.Normalize` instance
The normalizing object which scales data, typically into the
interval ``[0, 1]``.
If not given or *None*, norm defaults to a *colors.Normalize*
object which initializes its scaling based on the first
data processed.
If *None*, *norm* defaults to a *colors.Normalize* object which
initializes its scaling based on the first data processed.
cmap : str or :class:`~matplotlib.colors.Colormap` instance
The colormap used to map normalized data values to RGBA colors.

"""

self.callbacksSM = cbook.CallbackRegistry()
Expand Down
10 changes: 4 additions & 6 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,12 +905,10 @@ def process_value(value):

def __call__(self, value, clip=None):
"""
``norm.__call__(value) <==> norm(value)``

Normalize data in the ``[vmin, vmax]`` interval into the
``[0.0, 1.0]`` interval. *clip* defaults to *self.clip*
(which defaults to *False*). If not already initialized,
*vmin* and *vmax* are initialized using
Normalize *value* data in the ``[vmin, vmax]`` interval into
the ``[0.0, 1.0]`` interval and return it. *clip* defaults
to *self.clip* (which defaults to *False*). If not already
initialized, *vmin* and *vmax* are initialized using
*autoscale_None(value)*.
"""
if clip is None:
Expand Down