Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c685f36

Browse filesBrowse files
tacaswellksunden
authored andcommitted
DOC: fix colorizer related xrefs
1 parent 1ecfe95 commit c685f36
Copy full SHA for c685f36

File tree

Expand file treeCollapse file tree

2 files changed

+60
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+60
-8
lines changed

‎doc/api/cm_api.rst

Copy file name to clipboardExpand all lines: doc/api/cm_api.rst
+51Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,54 @@
66
:members:
77
:undoc-members:
88
:show-inheritance:
9+
10+
11+
.. class:: ScalarMappable(colorizer, **kwargs)
12+
:canonical: matplotlib.colorizer._ScalarMappable
13+
14+
.. attribute:: colorbar
15+
.. method:: changed
16+
17+
Call this whenever the mappable is changed to notify all the
18+
callbackSM listeners to the 'changed' signal.
19+
20+
.. method:: set_array(A)
21+
22+
Set the value array from array-like *A*.
23+
24+
25+
:Parameters:
26+
27+
**A** : array-like or None
28+
The values that are mapped to colors.
29+
30+
The base class `.ScalarMappable` does not make any assumptions on
31+
the dimensionality and shape of the value array *A*.
32+
33+
34+
35+
.. method:: set_cmap(A)
36+
37+
Set the colormap for luminance data.
38+
39+
40+
:Parameters:
41+
42+
**cmap** : `.Colormap` or str or None
43+
..
44+
45+
46+
.. method:: set_clim(vmin=None, vmax=None)
47+
48+
Set the norm limits for image scaling.
49+
50+
51+
:Parameters:
52+
53+
**vmin, vmax** : float
54+
The limits.
55+
56+
For scalar data, the limits may also be passed as a
57+
tuple (*vmin*, *vmax*) as a single positional argument.
58+
59+
.. ACCEPTS: (vmin: float, vmax: float)

‎lib/matplotlib/colorizer.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorizer.py
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
class Colorizer:
3939
"""
4040
Class that holds the data to color pipeline
41-
accessible via `Colorizer.to_rgba(A)` and executed via
42-
the `Colorizer.norm` and `Colorizer.cmap` attributes.
41+
accessible via `.Colorizer.to_rgba` and executed via
42+
the `.Colorizer.norm` and `.Colorizer.cmap` attributes.
4343
"""
4444
def __init__(self, cmap=None, norm=None):
4545

@@ -306,11 +306,11 @@ def clip(self, clip):
306306
class _ColorizerInterface:
307307
"""
308308
Base class that contains the interface to `Colorizer` objects from
309-
a `ColorizingArtist` or `cm.ScalarMappable`.
309+
a `ColorizingArtist` or `.cm.ScalarMappable`.
310310
311311
Note: This class only contain functions that interface the .colorizer
312-
attribute. Other functions that as shared between `ColorizingArtist`
313-
and `cm.ScalarMappable` are not included.
312+
attribute. Other functions that as shared between `.ColorizingArtist`
313+
and `.cm.ScalarMappable` are not included.
314314
"""
315315
def _scale_norm(self, norm, vmin, vmax):
316316
self._colorizer._scale_norm(norm, vmin, vmax, self._A)
@@ -486,8 +486,9 @@ class _ScalarMappable(_ColorizerInterface):
486486
A mixin class to map one or multiple sets of scalar data to RGBA.
487487
488488
The ScalarMappable applies data normalization before returning RGBA colors
489-
from the given `~matplotlib.colors.Colormap`, `~matplotlib.colors.BivarColormap`,
490-
or `~matplotlib.colors.MultivarColormap`.
489+
from the given `~matplotlib.colors.Colormap`, or
490+
`~matplotlib.colors.BivarColormap`.
491+
491492
"""
492493

493494
# _ScalarMappable exists for compatibility with
@@ -623,7 +624,7 @@ def __init__(self, colorizer, **kwargs):
623624
"""
624625
Parameters
625626
----------
626-
colorizer : `colorizer.Colorizer`
627+
colorizer : `.colorizer.Colorizer`
627628
"""
628629
if not isinstance(colorizer, Colorizer):
629630
raise ValueError("A `mpl.colorizer.Colorizer` object must be provided")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.