-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathcolors_api.html
More file actions
294 lines (272 loc) · 25.2 KB
/
colors_api.html
File metadata and controls
294 lines (272 loc) · 25.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>matplotlib.colors — Matplotlib 3.4.1 documentation</title>
<link rel="stylesheet" href="../_static/mpl.css?v3.4.1-3-gc6d08c6a8b-dirty" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/gallery.css" />
<link rel="stylesheet" type="text/css" href="../_static/gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="../_static/gallery-dataframe.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/clipboard.min.js"></script>
<script src="../_static/copybutton.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Matplotlib 3.4.1 documentation"
href="../_static/opensearch.xml"/>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="matplotlib.colors.BoundaryNorm" href="_as_gen/matplotlib.colors.BoundaryNorm.html" />
<link rel="prev" title="matplotlib.colorbar" href="colorbar_api.html" />
<link rel="top" title="Matplotlib 3.4.1 documentation" href="#" />
<link rel="canonical" href="https://matplotlib.org/stable/api/colors_api.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<script data-domain="matplotlib.org" defer="defer" src="https://views.scientific-python.org/js/script.js"></script>
</head><body>
<div id="unreleased-message"> You are reading an old version of the documentation (v3.4.1). For the latest version see <a href="https://matplotlib.org/stable/api/colors_api.html">https://matplotlib.org/stable/api/colors_api.html</a></div>
<!--
<div id="annc-banner">
</div>
-->
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
<a href="../index.html">
<div style="float: left; position: absolute; width: 496px; bottom: 0; padding-bottom: 24px"><span style="float: right; color: #789; background: white">Version 3.4.1</span></div>
<img src="../_static/logo2_compressed.svg" height="125px" border="0" alt="matplotlib"/></a>
<!-- The "Fork me on github" ribbon -->
<div id="forkongithub"><a href="https://github.com/matplotlib/matplotlib">Fork me on GitHub</a></div>
</div>
<nav class="main-nav">
<ul>
<li><a href="../users/installing.html">Installation</a></li>
<li><a href="../contents.html">Documentation</a></li>
<li><a href="../gallery/index.html">Examples</a></li>
<li><a href="../tutorials/index.html">Tutorials</a></li>
<li><a href="../devel/index.html">Contributing</a></li>
<li class="nav-right">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" placeholder="Search"/>
</form>
</li>
</ul>
</nav>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="_as_gen/matplotlib.colors.BoundaryNorm.html" title="matplotlib.colors.BoundaryNorm"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="colorbar_api.html" title="matplotlib.colorbar"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">home</a>| </li>
<li><a href="../contents.html">contents</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">API Overview</a> »</li>
<li class="nav-item nav-item-this"><a href=""><code class="docutils literal notranslate"><span class="pre">matplotlib.colors</span></code></a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">matplotlib.colors</span></code></a><ul>
<li><a class="reference internal" href="#classes">Classes</a></li>
<li><a class="reference internal" href="#functions">Functions</a></li>
</ul>
</li>
</ul>
<div id="sidebar-pagesource" role="note" aria-label="source link"
style="margin-top: 1.5em; padding-top: 0.1em; border-top: 1px solid #86989b">
<a href="../_sources/api/colors_api.rst.txt"
style="color: #c0c0c0" rel="nofollow">Show Page Source</a>
</div>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="matplotlib-colors">
<h1><code class="docutils literal notranslate"><span class="pre">matplotlib.colors</span></code><a class="headerlink" href="#matplotlib-colors" title="Permalink to this headline">¶</a></h1>
<p>The Color <a class="reference internal" href="../tutorials/index.html#tutorials-colors"><span class="std std-ref">tutorials</span></a> and <a class="reference internal" href="../gallery/index.html#color-examples"><span class="std std-ref">examples</span></a> demonstrate how to set colors and colormaps.</p>
<span class="target" id="module-matplotlib.colors"></span><p>A module for converting numbers or color arguments to <em>RGB</em> or <em>RGBA</em>.</p>
<p><em>RGB</em> and <em>RGBA</em> are sequences of, respectively, 3 or 4 floats in the
range 0-1.</p>
<p>This module includes functions and classes for color specification conversions,
and for mapping numbers to colors in a 1-D array of colors called a colormap.</p>
<p>Mapping data onto colors using a colormap typically involves two steps: a data
array is first mapped onto the range 0-1 using a subclass of <a class="reference internal" href="_as_gen/matplotlib.colors.Normalize.html#matplotlib.colors.Normalize" title="matplotlib.colors.Normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Normalize</span></code></a>,
then this number is mapped to a color using a subclass of <a class="reference internal" href="_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap" title="matplotlib.colors.Colormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Colormap</span></code></a>. Two
subclasses of <a class="reference internal" href="_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap" title="matplotlib.colors.Colormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Colormap</span></code></a> provided here: <a class="reference internal" href="_as_gen/matplotlib.colors.LinearSegmentedColormap.html#matplotlib.colors.LinearSegmentedColormap" title="matplotlib.colors.LinearSegmentedColormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LinearSegmentedColormap</span></code></a>, which uses
piecewise-linear interpolation to define colormaps, and <a class="reference internal" href="_as_gen/matplotlib.colors.ListedColormap.html#matplotlib.colors.ListedColormap" title="matplotlib.colors.ListedColormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ListedColormap</span></code></a>, which
makes a colormap from a list of colors.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p><a class="reference internal" href="../tutorials/colors/colormap-manipulation.html"><span class="doc">Creating Colormaps in Matplotlib</span></a> for examples of how to
make colormaps and</p>
<p><a class="reference internal" href="../tutorials/colors/colormaps.html"><span class="doc">Choosing Colormaps in Matplotlib</span></a> for a list of built-in colormaps.</p>
<p><a class="reference internal" href="../tutorials/colors/colormapnorms.html"><span class="doc">Colormap Normalization</span></a> for more details about data
normalization</p>
<p class="last">More colormaps are available at <a class="reference external" href="https://jiffyclub.github.io/palettable/">palettable</a>.</p>
</div>
<p>The module also provides functions for checking whether an object can be
interpreted as a color (<a class="reference internal" href="_as_gen/matplotlib.colors.is_color_like.html#matplotlib.colors.is_color_like" title="matplotlib.colors.is_color_like"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_color_like</span></code></a>), for converting such an object
to an RGBA tuple (<a class="reference internal" href="_as_gen/matplotlib.colors.to_rgba.html#matplotlib.colors.to_rgba" title="matplotlib.colors.to_rgba"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_rgba</span></code></a>) or to an HTML-like hex string in the
"#rrggbb" format (<a class="reference internal" href="_as_gen/matplotlib.colors.to_hex.html#matplotlib.colors.to_hex" title="matplotlib.colors.to_hex"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_hex</span></code></a>), and a sequence of colors to an (n, 4)
RGBA array (<a class="reference internal" href="_as_gen/matplotlib.colors.to_rgba_array.html#matplotlib.colors.to_rgba_array" title="matplotlib.colors.to_rgba_array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_rgba_array</span></code></a>). Caching is used for efficiency.</p>
<p>Matplotlib recognizes the following formats to specify a color:</p>
<ul class="simple">
<li>an RGB or RGBA (red, green, blue, alpha) tuple of float values in closed
interval <code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">1]</span></code> (e.g., <code class="docutils literal notranslate"><span class="pre">(0.1,</span> <span class="pre">0.2,</span> <span class="pre">0.5)</span></code> or <code class="docutils literal notranslate"><span class="pre">(0.1,</span> <span class="pre">0.2,</span> <span class="pre">0.5,</span> <span class="pre">0.3)</span></code>);</li>
<li>a hex RGB or RGBA string (e.g., <code class="docutils literal notranslate"><span class="pre">'#0f0f0f'</span></code> or <code class="docutils literal notranslate"><span class="pre">'#0f0f0f80'</span></code>;
case-insensitive);</li>
<li>a shorthand hex RGB or RGBA string, equivalent to the hex RGB or RGBA
string obtained by duplicating each character, (e.g., <code class="docutils literal notranslate"><span class="pre">'#abc'</span></code>, equivalent
to <code class="docutils literal notranslate"><span class="pre">'#aabbcc'</span></code>, or <code class="docutils literal notranslate"><span class="pre">'#abcd'</span></code>, equivalent to <code class="docutils literal notranslate"><span class="pre">'#aabbccdd'</span></code>;
case-insensitive);</li>
<li>a string representation of a float value in <code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">1]</span></code> inclusive for gray
level (e.g., <code class="docutils literal notranslate"><span class="pre">'0.5'</span></code>);</li>
<li>one of the characters <code class="docutils literal notranslate"><span class="pre">{'b',</span> <span class="pre">'g',</span> <span class="pre">'r',</span> <span class="pre">'c',</span> <span class="pre">'m',</span> <span class="pre">'y',</span> <span class="pre">'k',</span> <span class="pre">'w'}</span></code>, which
are short-hand notations for shades of blue, green, red, cyan, magenta,
yellow, black, and white. Note that the colors <code class="docutils literal notranslate"><span class="pre">'g',</span> <span class="pre">'c',</span> <span class="pre">'m',</span> <span class="pre">'y'</span></code> do not
coincide with the X11/CSS4 colors. Their particular shades were chosen for
better visibility of colored lines against typical backgrounds.</li>
<li>a X11/CSS4 color name (case-insensitive);</li>
<li>a name from the <a class="reference external" href="https://xkcd.com/color/rgb/">xkcd color survey</a>, prefixed with <code class="docutils literal notranslate"><span class="pre">'xkcd:'</span></code> (e.g.,
<code class="docutils literal notranslate"><span class="pre">'xkcd:sky</span> <span class="pre">blue'</span></code>; case insensitive);</li>
<li>one of the Tableau Colors from the 'T10' categorical palette (the default
color cycle): <code class="docutils literal notranslate"><span class="pre">{'tab:blue',</span> <span class="pre">'tab:orange',</span> <span class="pre">'tab:green',</span> <span class="pre">'tab:red',</span>
<span class="pre">'tab:purple',</span> <span class="pre">'tab:brown',</span> <span class="pre">'tab:pink',</span> <span class="pre">'tab:gray',</span> <span class="pre">'tab:olive',</span> <span class="pre">'tab:cyan'}</span></code>
(case-insensitive);</li>
<li>a "CN" color spec, i.e. 'C' followed by a number, which is an index into the
default property cycle (<code class="docutils literal notranslate"><a class="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.prop_cycle#a-sample-matplotlibrc-file"><span class="pre">rcParams["axes.prop_cycle"]</span></a></code> (default: <code class="docutils literal notranslate"><span class="pre">cycler('color',</span> <span class="pre">['#1f77b4',</span> <span class="pre">'#ff7f0e',</span> <span class="pre">'#2ca02c',</span> <span class="pre">'#d62728',</span> <span class="pre">'#9467bd',</span> <span class="pre">'#8c564b',</span> <span class="pre">'#e377c2',</span> <span class="pre">'#7f7f7f',</span> <span class="pre">'#bcbd22',</span> <span class="pre">'#17becf'])</span></code>)); the indexing is intended to
occur at rendering time, and defaults to black if the cycle does not include
color.</li>
</ul>
<div class="section" id="classes">
<h2>Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2>
<table border="1" class="longtable docutils align-default">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.BoundaryNorm.html#matplotlib.colors.BoundaryNorm" title="matplotlib.colors.BoundaryNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">BoundaryNorm</span></code></a>(boundaries, ncolors[, clip, extend])</td>
<td>Generate a colormap index based on discrete intervals.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap" title="matplotlib.colors.Colormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Colormap</span></code></a>(name[, N])</td>
<td>Baseclass for all scalar to RGBA mappings.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.CenteredNorm.html#matplotlib.colors.CenteredNorm" title="matplotlib.colors.CenteredNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">CenteredNorm</span></code></a>([vcenter, halfrange, clip])</td>
<td>Normalize symmetrical data around a center (0 by default).</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.LightSource.html#matplotlib.colors.LightSource" title="matplotlib.colors.LightSource"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LightSource</span></code></a>([azdeg, altdeg, hsv_min_val, ...])</td>
<td>Create a light source coming from the specified azimuth and elevation.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.LinearSegmentedColormap.html#matplotlib.colors.LinearSegmentedColormap" title="matplotlib.colors.LinearSegmentedColormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LinearSegmentedColormap</span></code></a>(name, segmentdata[, ...])</td>
<td>Colormap objects based on lookup tables using linear segments.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.ListedColormap.html#matplotlib.colors.ListedColormap" title="matplotlib.colors.ListedColormap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ListedColormap</span></code></a>(colors[, name, N])</td>
<td>Colormap object generated from a list of colors.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.LogNorm.html#matplotlib.colors.LogNorm" title="matplotlib.colors.LogNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LogNorm</span></code></a>([vmin, vmax, clip])</td>
<td></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.NoNorm.html#matplotlib.colors.NoNorm" title="matplotlib.colors.NoNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NoNorm</span></code></a>([vmin, vmax, clip])</td>
<td>Dummy replacement for <a class="reference internal" href="_as_gen/matplotlib.colors.Normalize.html#matplotlib.colors.Normalize" title="matplotlib.colors.Normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Normalize</span></code></a>, for the case where we want to use indices directly in a <a class="reference internal" href="cm_api.html#matplotlib.cm.ScalarMappable" title="matplotlib.cm.ScalarMappable"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ScalarMappable</span></code></a>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.Normalize.html#matplotlib.colors.Normalize" title="matplotlib.colors.Normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Normalize</span></code></a>([vmin, vmax, clip])</td>
<td>A class which, when called, linearly normalizes data into the <code class="docutils literal notranslate"><span class="pre">[0.0,</span> <span class="pre">1.0]</span></code> interval.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.PowerNorm.html#matplotlib.colors.PowerNorm" title="matplotlib.colors.PowerNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PowerNorm</span></code></a>(gamma[, vmin, vmax, clip])</td>
<td>Linearly map a given value to the 0-1 range and then apply a power-law normalization over that range.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.SymLogNorm.html#matplotlib.colors.SymLogNorm" title="matplotlib.colors.SymLogNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SymLogNorm</span></code></a>(linthresh[, linscale, vmin, ...])</td>
<td></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.TwoSlopeNorm.html#matplotlib.colors.TwoSlopeNorm" title="matplotlib.colors.TwoSlopeNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TwoSlopeNorm</span></code></a>(vcenter[, vmin, vmax])</td>
<td>Normalize data with a set center.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.FuncNorm.html#matplotlib.colors.FuncNorm" title="matplotlib.colors.FuncNorm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">FuncNorm</span></code></a>(functions[, vmin, vmax, clip])</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="functions">
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<table border="1" class="longtable docutils align-default">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.from_levels_and_colors.html#matplotlib.colors.from_levels_and_colors" title="matplotlib.colors.from_levels_and_colors"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_levels_and_colors</span></code></a>(levels, colors[, extend])</td>
<td>A helper routine to generate a cmap and a norm instance which behave similar to contourf's levels and colors arguments.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.hsv_to_rgb.html#matplotlib.colors.hsv_to_rgb" title="matplotlib.colors.hsv_to_rgb"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hsv_to_rgb</span></code></a>(hsv)</td>
<td>Convert hsv values to rgb.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.rgb_to_hsv.html#matplotlib.colors.rgb_to_hsv" title="matplotlib.colors.rgb_to_hsv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rgb_to_hsv</span></code></a>(arr)</td>
<td>Convert float rgb values (in the range [0, 1]), in a numpy array to hsv values.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.to_hex.html#matplotlib.colors.to_hex" title="matplotlib.colors.to_hex"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_hex</span></code></a>(c[, keep_alpha])</td>
<td>Convert <em>c</em> to a hex color.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.to_rgb.html#matplotlib.colors.to_rgb" title="matplotlib.colors.to_rgb"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_rgb</span></code></a>(c)</td>
<td>Convert <em>c</em> to an RGB color, silently dropping the alpha channel.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.to_rgba.html#matplotlib.colors.to_rgba" title="matplotlib.colors.to_rgba"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_rgba</span></code></a>(c[, alpha])</td>
<td>Convert <em>c</em> to an RGBA color.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.to_rgba_array.html#matplotlib.colors.to_rgba_array" title="matplotlib.colors.to_rgba_array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_rgba_array</span></code></a>(c[, alpha])</td>
<td>Convert <em>c</em> to a (n, 4) array of RGBA colors.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.is_color_like.html#matplotlib.colors.is_color_like" title="matplotlib.colors.is_color_like"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_color_like</span></code></a>(c)</td>
<td>Return whether <em>c</em> can be interpreted as an RGB(A) color.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="_as_gen/matplotlib.colors.same_color.html#matplotlib.colors.same_color" title="matplotlib.colors.same_color"><code class="xref py py-obj docutils literal notranslate"><span class="pre">same_color</span></code></a>(c1, c2)</td>
<td>Return whether the colors <em>c1</em> and <em>c2</em> are the same.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="_as_gen/matplotlib.colors.get_named_colors_mapping.html#matplotlib.colors.get_named_colors_mapping" title="matplotlib.colors.get_named_colors_mapping"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_named_colors_mapping</span></code></a>()</td>
<td>Return the global mapping of names to named colors.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<footer>
<div class="footer">
© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2021 The Matplotlib development team.
<br />
Last updated on Mar 31, 2021.
Created using
<a href="http://sphinx-doc.org/">Sphinx</a> 3.2.1.
Doc version v3.4.1-3-gc6d08c6a8b-dirty.
</div>
</footer>
</body>
</html>