Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46a878b

Browse filesBrowse files
committed
Merge pull request matplotlib#5678 from QuLogic/vega-cmap
Add new Vega colors as a ListedColormap
2 parents 9e0a46a + fc754aa commit 46a878b
Copy full SHA for 46a878b

File tree

Expand file treeCollapse file tree

2 files changed

+95
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+95
-1
lines changed

‎examples/color/colormaps_reference.py

Copy file name to clipboardExpand all lines: examples/color/colormaps_reference.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
5252
'seismic']),
5353
('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1',
54-
'Pastel2', 'Set1', 'Set2', 'Set3']),
54+
'Pastel2', 'Set1', 'Set2', 'Set3', 'Vega10',
55+
'Vega20', 'Vega20b', 'Vega20c']),
5556
('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern',
5657
'brg', 'CMRmap', 'cubehelix',
5758
'gnuplot', 'gnuplot2', 'gist_ncar',

‎lib/matplotlib/_cm.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_cm.py
+93Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,94 @@ def gfunc32(x):
12771277
}
12781278

12791279

1280+
# Categorical palettes from Vega:
1281+
# https://github.com/vega/vega/wiki/Scales
1282+
# (divided by 255)
1283+
#
1284+
1285+
_Vega10_data = (
1286+
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
1287+
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
1288+
(0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
1289+
(0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
1290+
(0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
1291+
(0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
1292+
(0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
1293+
(0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
1294+
(0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
1295+
(0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
1296+
)
1297+
1298+
_Vega20_data = (
1299+
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
1300+
(0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
1301+
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
1302+
(1.0, 0.7333333333333333, 0.47058823529411764 ), # ffbb78
1303+
(0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
1304+
(0.596078431372549, 0.8745098039215686, 0.5411764705882353 ), # 98df8a
1305+
(0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
1306+
(1.0, 0.596078431372549, 0.5882352941176471 ), # ff9896
1307+
(0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
1308+
(0.7725490196078432, 0.6901960784313725, 0.8352941176470589 ), # c5b0d5
1309+
(0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
1310+
(0.7686274509803922, 0.611764705882353, 0.5803921568627451 ), # c49c94
1311+
(0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
1312+
(0.9686274509803922, 0.7137254901960784, 0.8235294117647058 ), # f7b6d2
1313+
(0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
1314+
(0.7803921568627451, 0.7803921568627451, 0.7803921568627451 ), # c7c7c7
1315+
(0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
1316+
(0.8588235294117647, 0.8588235294117647, 0.5529411764705883 ), # dbdb8d
1317+
(0.09019607843137255, 0.7450980392156863, 0.8117647058823529 ), # 17becf
1318+
(0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
1319+
)
1320+
1321+
_Vega20b_data = (
1322+
(0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
1323+
(0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
1324+
(0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
1325+
(0.611764705882353, 0.6196078431372549, 0.8705882352941177 ), # 9c9ede
1326+
(0.38823529411764707, 0.4745098039215686, 0.2235294117647059 ), # 637939
1327+
(0.5490196078431373, 0.6352941176470588, 0.3215686274509804 ), # 8ca252
1328+
(0.7098039215686275, 0.8117647058823529, 0.4196078431372549 ), # b5cf6b
1329+
(0.807843137254902, 0.8588235294117647, 0.611764705882353 ), # cedb9c
1330+
(0.5490196078431373, 0.42745098039215684, 0.19215686274509805), # 8c6d31
1331+
(0.7411764705882353, 0.6196078431372549, 0.2235294117647059 ), # bd9e39
1332+
(0.9058823529411765, 0.7294117647058823, 0.3215686274509804 ), # e7ba52
1333+
(0.9058823529411765, 0.796078431372549, 0.5803921568627451 ), # e7cb94
1334+
(0.5176470588235295, 0.23529411764705882, 0.2235294117647059 ), # 843c39
1335+
(0.6784313725490196, 0.28627450980392155, 0.2901960784313726 ), # ad494a
1336+
(0.8392156862745098, 0.3803921568627451, 0.4196078431372549 ), # d6616b
1337+
(0.9058823529411765, 0.5882352941176471, 0.611764705882353 ), # e7969c
1338+
(0.4823529411764706, 0.2549019607843137, 0.45098039215686275), # 7b4173
1339+
(0.6470588235294118, 0.3176470588235294, 0.5803921568627451 ), # a55194
1340+
(0.807843137254902, 0.42745098039215684, 0.7411764705882353 ), # ce6dbd
1341+
(0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
1342+
)
1343+
1344+
_Vega20c_data = (
1345+
(0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
1346+
(0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
1347+
(0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
1348+
(0.7764705882352941, 0.8588235294117647, 0.9372549019607843 ), # c6dbef
1349+
(0.9019607843137255, 0.3333333333333333, 0.050980392156862744), # e6550d
1350+
(0.9921568627450981, 0.5529411764705883, 0.23529411764705882 ), # fd8d3c
1351+
(0.9921568627450981, 0.6823529411764706, 0.4196078431372549 ), # fdae6b
1352+
(0.9921568627450981, 0.8156862745098039, 0.6352941176470588 ), # fdd0a2
1353+
(0.19215686274509805, 0.6392156862745098, 0.32941176470588235 ), # 31a354
1354+
(0.4549019607843137, 0.7686274509803922, 0.4627450980392157 ), # 74c476
1355+
(0.6313725490196078, 0.8509803921568627, 0.6078431372549019 ), # a1d99b
1356+
(0.7803921568627451, 0.9137254901960784, 0.7529411764705882 ), # c7e9c0
1357+
(0.4588235294117647, 0.4196078431372549, 0.6941176470588235 ), # 756bb1
1358+
(0.6196078431372549, 0.6039215686274509, 0.7843137254901961 ), # 9e9ac8
1359+
(0.7372549019607844, 0.7411764705882353, 0.8627450980392157 ), # bcbddc
1360+
(0.8549019607843137, 0.8549019607843137, 0.9215686274509803 ), # dadaeb
1361+
(0.38823529411764707, 0.38823529411764707, 0.38823529411764707 ), # 636363
1362+
(0.5882352941176471, 0.5882352941176471, 0.5882352941176471 ), # 969696
1363+
(0.7411764705882353, 0.7411764705882353, 0.7411764705882353 ), # bdbdbd
1364+
(0.8509803921568627, 0.8509803921568627, 0.8509803921568627 ), # d9d9d9
1365+
)
1366+
1367+
12801368
datad = {
12811369
'afmhot': _afmhot_data,
12821370
'autumn': _autumn_data,
@@ -1358,3 +1446,8 @@ def gfunc32(x):
13581446
datad['Set1'] = {'listed': _Set1_data}
13591447
datad['Set2'] = {'listed': _Set2_data}
13601448
datad['Set3'] = {'listed': _Set3_data}
1449+
1450+
datad['Vega10'] = {'listed': _Vega10_data}
1451+
datad['Vega20'] = {'listed': _Vega20_data}
1452+
datad['Vega20b'] = {'listed': _Vega20b_data}
1453+
datad['Vega20c'] = {'listed': _Vega20c_data}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.