Skip to content

Commit 1dbfa54

Browse files
committed
X11/CSS4 example added, gallery reference moved up
changes to language with alpha
1 parent a9d3e6d commit 1dbfa54

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

tutorials/colors/colors.py

+21-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Specifying Colors
44
*****************
55
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.
78
89
+--------------------------------------+--------------------------------------+
910
| Format | Example |
@@ -15,9 +16,9 @@
1516
| Case-insensitive hex RGB or RGBA | - ``'#0f0f0f'`` |
1617
| string. | - ``'#0f0f0f80'`` |
1718
+--------------------------------------+--------------------------------------+
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. | |
2122
+--------------------------------------+--------------------------------------+
2223
| String representation of float value | - ``'0.8'`` as light gray |
2324
| in closed interval ``[0, 1]`` for | - ``'0'`` as black |
@@ -32,6 +33,9 @@
3233
| colors. | - ``'k'`` as black |
3334
| | - ``'w'`` as white |
3435
+--------------------------------------+--------------------------------------+
36+
| Case-insensitive X11/CSS4 color name | - 'aquamarine' |
37+
| with no spaces. | - 'mediumseagreen' |
38+
+--------------------------------------+--------------------------------------+
3539
| Case-insensitive color name from | - ``'xkcd:sky blue'`` |
3640
| `xkcd color survey`_ with ``'xkcd:'``| - ``'xkcd:eggshell'`` |
3741
| prefix. | |
@@ -59,13 +63,22 @@
5963
6064
.. _xkcd color survey: https://xkcd.com/color/rgb/
6165
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+
6273
"Red", "Green", and "Blue" are the intensities of those colors. In combination,
6374
they represent the colorspace.
6475
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.
6982
7083
The two Artists combine with alpha compositing. Matplotlib uses the equation
7184
below to compute the result of blending a new Artist.
@@ -91,12 +104,6 @@
91104
92105
Re-ordering Artists is not commutative in Matplotlib.
93106
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
100107
101108
"CN" color selection
102109
--------------------

0 commit comments

Comments
 (0)