|
3 | 3 | Specifying Colors
|
4 | 4 | *****************
|
5 | 5 |
|
6 |
| -Matplotlib recognizes the following formats to specify a color: |
| 6 | +Matplotlib recognizes the following formats in the table below to specify a |
| 7 | +color. |
7 | 8 |
|
8 | 9 | +--------------------------------------+--------------------------------------+
|
9 | 10 | | Format | Example |
|
|
15 | 16 | | Case-insensitive hex RGB or RGBA | - ``'#0f0f0f'`` |
|
16 | 17 | | string. | - ``'#0f0f0f80'`` |
|
17 | 18 | +--------------------------------------+--------------------------------------+
|
18 |
| -| Case-insensitive shorthand equivalent| - ``'#abc'`` as ``'#aabbcc'`` | |
19 |
| -| string of RGB or RGBA from duplicated| - ``'#abcd'`` as ``'#aabbccdd'`` | |
20 |
| -| characters. | | |
| 19 | +| Case-insensitive RGB or RGBA string | - ``'#abc'`` as ``'#aabbcc'`` | |
| 20 | +| equivalent hex shorthand of | - ``'#fb1'`` as ``'#ffbb11'`` | |
| 21 | +| duplicated characters. | | |
21 | 22 | +--------------------------------------+--------------------------------------+
|
22 | 23 | | String representation of float value | - ``'0.8'`` as light gray |
|
23 | 24 | | in closed interval ``[0, 1]`` for | - ``'0'`` as black |
|
|
32 | 33 | | colors. | - ``'k'`` as black |
|
33 | 34 | | | - ``'w'`` as white |
|
34 | 35 | +--------------------------------------+--------------------------------------+
|
| 36 | +| Case-insensitive X11/CSS4 color name | - 'aquamarine' | |
| 37 | +| with no spaces. | - 'mediumseagreen' | |
| 38 | ++--------------------------------------+--------------------------------------+ |
35 | 39 | | Case-insensitive color name from | - ``'xkcd:sky blue'`` |
|
36 | 40 | | `xkcd color survey`_ with ``'xkcd:'``| - ``'xkcd:eggshell'`` |
|
37 | 41 | | prefix. | |
|
|
59 | 63 |
|
60 | 64 | .. _xkcd color survey: https://xkcd.com/color/rgb/
|
61 | 65 |
|
| 66 | +.. seealso:: |
| 67 | +
|
| 68 | + The following links provide more information on colors in Matplotlib. |
| 69 | + * :doc:`/gallery/color/color_demo` Example |
| 70 | + * `matplotlib.colors` API |
| 71 | + * :doc:`/gallery/color/named_colors` Example |
| 72 | +
|
62 | 73 | "Red", "Green", and "Blue" are the intensities of those colors. In combination,
|
63 | 74 | they represent the colorspace.
|
64 | 75 |
|
65 |
| -Matplotlib composes Artists based on the ``zorder`` keyword argument. If there |
66 |
| -are no specified values, Matplotlib defaults to the order of the Artists added |
67 |
| -to the Axes. The alpha for an Artist controls how the RGB color of the new |
68 |
| -Artist combines with RGB colors already on the Axes. |
| 76 | +Matplotlib draws Artists based on the ``zorder`` parameter. If there are no |
| 77 | +specified values, Matplotlib defaults to the order of the Artists added to the |
| 78 | +Axes. |
| 79 | +
|
| 80 | +The alpha for an Artist controls opacity. It indicates how the RGB color of the |
| 81 | +new Artist combines with RGB colors already on the Axes. |
69 | 82 |
|
70 | 83 | The two Artists combine with alpha compositing. Matplotlib uses the equation
|
71 | 84 | below to compute the result of blending a new Artist.
|
|
91 | 104 |
|
92 | 105 | Re-ordering Artists is not commutative in Matplotlib.
|
93 | 106 |
|
94 |
| -.. seealso:: |
95 |
| -
|
96 |
| - The following links provide more information on colors in Matplotlib. |
97 |
| - * :doc:`/gallery/color/color_demo` Example |
98 |
| - * `matplotlib.colors` API |
99 |
| - * :doc:`/gallery/color/named_colors` Example |
100 | 107 |
|
101 | 108 | "CN" color selection
|
102 | 109 | --------------------
|
|
0 commit comments