🌐 AI搜索 & 代理 主页
Skip to content

Commit 1aa6f0b

Browse files
committed
Renamed color sequence to authors name (Okabe Ito)
1 parent f9fd1f3 commit 1aa6f0b

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

galleries/examples/color/color_sequences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def plot_color_sequences(names, ax):
3838

3939
built_in_color_sequences = [
4040
'tab10', 'tab20', 'tab20b', 'tab20c', 'Pastel1', 'Pastel2', 'Paired',
41-
'Accent', 'Accessible', 'Dark2', 'Set1', 'Set2', 'Set3', 'petroff6',
41+
'Accent', 'Okabe-Ito', 'Dark2', 'Set1', 'Set2', 'Set3', 'petroff6',
4242
'petroff8', 'petroff10']
4343

4444

lib/matplotlib/_cm.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,6 @@ def _g36(x): return 2 * x - 1
852852
(0.50196078431372548, 0.0 , 0.14901960784313725)
853853
)
854854

855-
856855
# ColorBrewer's qualitative maps, implemented using ListedColormap
857856
# for use with mpl.colors.NoNorm
858857

@@ -867,12 +866,23 @@ def _g36(x): return 2 * x - 1
867866
(0.4, 0.4, 0.4 ),
868867
)
869868

870-
# Okabe-Ito accessible color palette (2002).
869+
_Dark2_data = (
870+
(0.10588235294117647, 0.61960784313725492, 0.46666666666666667),
871+
(0.85098039215686272, 0.37254901960784315, 0.00784313725490196),
872+
(0.45882352941176469, 0.4392156862745098, 0.70196078431372544),
873+
(0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
874+
(0.4, 0.65098039215686276, 0.11764705882352941),
875+
(0.90196078431372551, 0.6705882352941176, 0.00784313725490196),
876+
(0.65098039215686276, 0.46274509803921571, 0.11372549019607843),
877+
(0.4, 0.4, 0.4 ),
878+
)
879+
880+
# Okabe-Ito accessible and print-friendly color palette (2002).
871881
# By Masataka Okabe (Jikei Medical School) and Kei Ito (University of Tokyo).
872-
# Qualitative color palette that is unambiguous regardless of whether the viewer has colorblindness.
873-
# https://jfly.uni-koeln.de/color/#pallet
882+
# Qualitative color palette that is unambiguous regardless of whether
883+
# the viewer has colorblindness. https://jfly.uni-koeln.de/color/#pallet
874884

875-
_Accessible_data = (
885+
_Okabe_Ito_data = (
876886
(0.0, 0.0, 0.0), # black
877887
(0.901960784, 0.623529412, 0.0), # e69f00
878888
(0.337254902, 0.705882353, 0.91372549), # 56b4e9
@@ -883,17 +893,6 @@ def _g36(x): return 2 * x - 1
883893
(0.8, 0.474509804, 0.654901961), # cc79a7
884894
)
885895

886-
_Dark2_data = (
887-
(0.10588235294117647, 0.61960784313725492, 0.46666666666666667),
888-
(0.85098039215686272, 0.37254901960784315, 0.00784313725490196),
889-
(0.45882352941176469, 0.4392156862745098, 0.70196078431372544),
890-
(0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
891-
(0.4, 0.65098039215686276, 0.11764705882352941),
892-
(0.90196078431372551, 0.6705882352941176, 0.00784313725490196),
893-
(0.65098039215686276, 0.46274509803921571, 0.11372549019607843),
894-
(0.4, 0.4, 0.4 ),
895-
)
896-
897896
_Paired_data = (
898897
(0.65098039215686276, 0.80784313725490198, 0.8901960784313725 ),
899898
(0.12156862745098039, 0.47058823529411764, 0.70588235294117652),
@@ -1485,7 +1484,7 @@ def _gist_yarg(x): return 1 - x
14851484
'winter': _winter_data,
14861485
# Qualitative
14871486
'Accent': {'listed': _Accent_data},
1488-
'Accessible': {'listed': _Accessible_data},
1487+
'Okabe-Ito': {'listed': _Okabe_Ito_data},
14891488
'Dark2': {'listed': _Dark2_data},
14901489
'Paired': {'listed': _Paired_data},
14911490
'Pastel1': {'listed': _Pastel1_data},

lib/matplotlib/cm.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ summer: colors.Colormap
9696
terrain: colors.Colormap
9797
winter: colors.Colormap
9898
Accent: colors.Colormap
99-
Accessible: colors.Colormap
10099
Dark2: colors.Colormap
100+
Okabe_Ito: colors.Colormap
101101
Paired: colors.Colormap
102102
Pastel1: colors.Colormap
103103
Pastel2: colors.Colormap
@@ -188,8 +188,8 @@ summer_r: colors.Colormap
188188
terrain_r: colors.Colormap
189189
winter_r: colors.Colormap
190190
Accent_r: colors.Colormap
191-
Accessible_r: colors.Colormap
192191
Dark2_r: colors.Colormap
192+
Okabe_Ito_r: colors.Colormap
193193
Paired_r: colors.Colormap
194194
Pastel1_r: colors.Colormap
195195
Pastel2_r: colors.Colormap

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ class ColorSequenceRegistry(Mapping):
128128
'Pastel2': _cm._Pastel2_data,
129129
'Paired': _cm._Paired_data,
130130
'Accent': _cm._Accent_data,
131-
'Accessible': _cm._Accessible_data,
132131
'Dark2': _cm._Dark2_data,
133132
'Set1': _cm._Set1_data,
134133
'Set2': _cm._Set2_data,
135134
'Set3': _cm._Set3_data,
135+
'Okabe-Ito': _cm._Okabe_Ito_data,
136136
'petroff6': _cm._petroff6_data,
137137
'petroff8': _cm._petroff8_data,
138138
'petroff10': _cm._petroff10_data,

lib/matplotlib/tests/test_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ def test_color_sequences():
17021702
assert plt.color_sequences is matplotlib.color_sequences # same registry
17031703
assert list(plt.color_sequences) == [
17041704
'tab10', 'tab20', 'tab20b', 'tab20c', 'Pastel1', 'Pastel2', 'Paired',
1705-
'Accent', 'Accessible', 'Dark2', 'Set1', 'Set2', 'Set3', 'petroff6',
1705+
'Accent', 'Okabe-Ito', 'Dark2', 'Set1', 'Set2', 'Set3', 'petroff6',
17061706
'petroff8', 'petroff10']
17071707
assert len(plt.color_sequences['tab10']) == 10
17081708
assert len(plt.color_sequences['tab20']) == 20

0 commit comments

Comments
 (0)