Do not reverse colormaps with _r suffix a second time
@@ -691,14 +691,16 @@ def _list_cmaps(provider=None, records=False):
else:
mpl_cmaps = list(cm.cmaps_listed)+list(cm.datad)
cmaps += info('matplotlib', mpl_cmaps)
- cmaps += info('matplotlib', [cmap+'_r' for cmap in mpl_cmaps])
+ cmaps += info('matplotlib', [cmap+'_r' for cmap in mpl_cmaps
+ if not cmap.endswith('_r')])
except:
pass
if 'bokeh' in provider:
try:
from bokeh import palettes
cmaps += info('bokeh', palettes.all_palettes)
- cmaps += info('bokeh', [p+'_r' for p in palettes.all_palettes])
+ cmaps += info('bokeh', [p+'_r' for p in palettes.all_palettes
+ if not p.endswith('_r')])
except:
pass
if 'colorcet' in provider:
@@ -707,7 +709,7 @@ def _list_cmaps(provider=None, records=False):
cet_maps = palette_n.copy()
cet_maps['glasbey_hv'] = glasbey_hv # Add special hv-specific map
cmaps += info('colorcet', cet_maps)
- cmaps += info('colorcet', [p+'_r' for p in cet_maps])
+ cmaps += info('colorcet', [p+'_r' for p in cet_maps if not p.endswith('_r')])
except:
pass
return sorted(unique_iterator(cmaps))
