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

Skip to content

Commit 3b2c517

Browse files
committed
Mention single char colors shading in more places.
Fixes #17591.
1 parent f8d10f5 commit 3b2c517

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

examples/color/color_demo.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66
Matplotlib recognizes the following formats to specify a color:
77
88
1) an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g. ``(0.1, 0.2, 0.5)``
9-
or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha;
9+
or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha;
1010
2) a hex RGB or RGBA string (e.g., ``'#0F0F0F'`` or ``'#0F0F0F0F'``);
1111
3) a string representation of a float value in ``[0, 1]`` inclusive for gray
1212
level (e.g., ``'0.5'``);
1313
4) a single letter string, i.e. one of
14-
``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``;
14+
``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``, which are short-hand notations
15+
for shades of blue, green, red, cyan, magenta, yellow, black, and white;
1516
5) a X11/CSS4 ("html") color name, e.g. ``"blue"``;
1617
6) a name from the `xkcd color survey <https://xkcd.com/color/rgb/>`__,
1718
prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``);
1819
7) a "Cn" color spec, i.e. ``'C'`` followed by a number, which is an index into
1920
the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended
2021
to occur at rendering time, and defaults to black if the cycle does not
2122
include color.
22-
8) one of ``{'tab:blue', 'tab:orange', 'tab:green',
23-
'tab:red', 'tab:purple', 'tab:brown', 'tab:pink',
24-
'tab:gray', 'tab:olive', 'tab:cyan'}`` which are the Tableau Colors from the
25-
'tab10' categorical palette (which is the default color cycle);
23+
8) one of ``{'tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple',
24+
'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'}`` which are
25+
the Tableau Colors from the 'tab10' categorical palette (which is the
26+
default color cycle);
2627
2728
For more information on colors in matplotlib see
2829

lib/matplotlib/colors.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444
case-insensitive);
4545
* a string representation of a float value in ``[0, 1]`` inclusive for gray
4646
level (e.g., ``'0.5'``);
47-
* one of ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``, they are the single
48-
character short-hand notations for blue, green, red, cyan, magenta, yellow,
49-
black, and white.
47+
* one of the characters ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``, which
48+
are short-hand notations for shades of blue, green, red, cyan, magenta,
49+
yellow, black, and white. Note that the colors ``'g', 'c', 'm', 'y'`` do not
50+
coincide with the X11/CSS4 colors. Their particular shades were chosen for
51+
better visibility of colored lines against typical backgrounds.
5052
* a X11/CSS4 color name (case-insensitive);
5153
* a name from the `xkcd color survey`_, prefixed with ``'xkcd:'`` (e.g.,
5254
``'xkcd:sky blue'``; case insensitive);

0 commit comments

Comments
 (0)