Skip to content

Commit 96329f8

Browse files
committed
New cmap
1 parent 29cdcc8 commit 96329f8

4 files changed

Lines changed: 61 additions & 7 deletions

File tree

docs/showcase.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ for usage details.
15431543
15441544
.. image:: showcase/showcase_100_1.png
15451545
:width: 436px
1546-
:height: 4383px
1546+
:height: 4409px
15471547

15481548

15491549
Table of color cycles

docs/showcase/showcase_100_1.png

1.84 KB
Loading

proplot/cmaps/Dusk.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"hue": [
3+
[
4+
0.0,
5+
233.561001627876,
6+
233.561001627876
7+
],
8+
[
9+
1.0,
10+
282.6114815967624,
11+
282.6114815967624
12+
]
13+
],
14+
"saturation": [
15+
[
16+
0.0,
17+
100.0,
18+
100.0
19+
],
20+
[
21+
1.0,
22+
100.0,
23+
100.0
24+
]
25+
],
26+
"luminance": [
27+
[
28+
0.0,
29+
100.0,
30+
100.0
31+
],
32+
[
33+
1.0,
34+
10.0,
35+
10.0
36+
]
37+
],
38+
"alpha": [
39+
[
40+
0.0,
41+
1.0,
42+
1.0
43+
],
44+
[
45+
1.0,
46+
1.0,
47+
1.0
48+
]
49+
],
50+
"gamma1": 1.0,
51+
"gamma2": 1.0,
52+
"space": "hpl"
53+
}

proplot/colortools.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@
306306

307307
# Custom maps
308308
'ProPlot Sequential': [
309-
'Glacial',
309+
'Glacial',
310+
'Dusk',
310311
'Bog', 'Verdant',
311312
'Turquoise',
312313
'Sunrise', 'Sunset', 'Fire',
@@ -896,8 +897,8 @@ def _clip_cmap(cmap, left=None, right=None, N=None):
896897
left = 0
897898
if right is None:
898899
right = 1
899-
if hasattr(cmap, 'space'):
900-
kwargs['space'] = cmap.space
900+
if hasattr(cmap, '_space'):
901+
kwargs['space'] = cmap._space
901902
# Next resample the segmentdata arrays
902903
dict_ = {key:value for key,value in data.items() if
903904
key not in ('gamma1','gamma2')}
@@ -1393,9 +1394,9 @@ def Colormap(*args, name=None, cyclic=False, N=None,
13931394
filename = os.path.join(_data_user, basename)
13941395
data = {}
13951396
for key,value in cmap._segmentdata.items():
1396-
data[key] = value.astype(float).tolist() # from np.float to builtin float, and to list of lists
1397-
if hasattr(cmap, 'space'):
1398-
data['space'] = cmap.space
1397+
data[key] = np.array(value).astype(float).tolist() # from np.float to builtin float, and to list of lists
1398+
if hasattr(cmap, '_space'):
1399+
data['space'] = cmap._space
13991400
with open(filename, 'w') as file:
14001401
json.dump(data, file, indent=4)
14011402
print(f'Saved colormap to "{basename}".')

0 commit comments

Comments
 (0)