Skip to content

Commit 7fd60fc

Browse files
rcomerQuLogictimhoffm
authored
Apply suggestions from code review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 846e825 commit 7fd60fc

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

doc/users/next_whats_new/color_cycle_from_sequence.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ a style file to use any of the :doc:`/gallery/color/color_sequences`. For examp
66

77
.. code-block:: python
88
9-
axes.prop_cycle : cycler('color', 'Accent')
9+
axes.prop_cycle : cycler(color='Accent')

galleries/users_explain/artists/color_cycle.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@
7878
# Remember, a custom cycler can be set in your :file:`matplotlibrc`
7979
# file or a style file (:file:`style.mplstyle`) under ``axes.prop_cycle``, e.g.
8080
#
81-
# .. code-block:: python
81+
# .. code-block:: none
8282
#
83-
# axes.prop-cycle : cycler('color', ['red', 'royalblue', 'gray'])
83+
# axes.prop-cycle : cycler(color=['red', 'royalblue', 'gray'])
8484
#
8585
# For colors, a single string may be used either for one of the
8686
# :doc:`/gallery/color/color_sequences`
8787
#
8888
# .. code-block:: python
8989
#
90-
# axes.prop_cycle : cycler('color', 'Accent')
90+
# axes.prop_cycle : cycler(color='Accent')
9191
#
9292
# or if each color has a single character name:
9393
#

lib/matplotlib/mpl-data/matplotlibrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417

418418
#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See
419419
# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
420-
#axes.prop_cycle: cycler('color', 'tab10')
420+
#axes.prop_cycle: cycler(color='tab10')
421421
# color cycle for plot lines as either a named color sequence or a list
422422
# of string color specs: single letter, long name, or web-style hex
423423
# As opposed to all other parameters in this file, the color

lib/matplotlib/rcsetup.py

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ def __call__(self, s):
9595

9696

9797
def _single_string_color_list(s, scalar_validator):
98+
"""
99+
Convert *s* to a list of colors interpreting it either a color sequence name,
100+
or a string containing single-letter colors.
101+
"""
98102
try:
99103
colors = mpl.color_sequences[s]
100104
except KeyError as ke:

0 commit comments

Comments
 (0)