|
306 | 306 |
|
307 | 307 | # Custom maps |
308 | 308 | 'ProPlot Sequential': [ |
309 | | - 'Glacial', |
| 309 | + 'Glacial', |
| 310 | + 'Dusk', |
310 | 311 | 'Bog', 'Verdant', |
311 | 312 | 'Turquoise', |
312 | 313 | 'Sunrise', 'Sunset', 'Fire', |
@@ -896,8 +897,8 @@ def _clip_cmap(cmap, left=None, right=None, N=None): |
896 | 897 | left = 0 |
897 | 898 | if right is None: |
898 | 899 | right = 1 |
899 | | - if hasattr(cmap, 'space'): |
900 | | - kwargs['space'] = cmap.space |
| 900 | + if hasattr(cmap, '_space'): |
| 901 | + kwargs['space'] = cmap._space |
901 | 902 | # Next resample the segmentdata arrays |
902 | 903 | dict_ = {key:value for key,value in data.items() if |
903 | 904 | key not in ('gamma1','gamma2')} |
@@ -1393,9 +1394,9 @@ def Colormap(*args, name=None, cyclic=False, N=None, |
1393 | 1394 | filename = os.path.join(_data_user, basename) |
1394 | 1395 | data = {} |
1395 | 1396 | 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 |
1399 | 1400 | with open(filename, 'w') as file: |
1400 | 1401 | json.dump(data, file, indent=4) |
1401 | 1402 | print(f'Saved colormap to "{basename}".') |
|
0 commit comments