Project

General

Profile

Revision 816:d52976b6ccfc

IDd52976b6ccfc
Parent 815:c0e5b3712092
Child 817:b1891bf5727b

Added by Maarten Sneep about 2 years ago

Remove deprecated access to internal dictionary

View differences:

src/matplotlib_colormaps.py
35 35
    # Get a list of the colormaps in matplotlib.  Ignore the ones that end with
36 36
    # '_r' because these are simply reversed versions of ones that don't end
37 37
    # with '_r'
38
    maps = [m for m in plt.cm.datad if not m.endswith("_r")]
39
    maps.extend([m for m in plt.cm.cmap_d if not m.endswith("_r")])
40
    maps = list(set(maps))
38
    maps = [m for m in plt.colormaps() if not m.endswith("_r")]
41 39
    maps.sort(key=lambda s: s.lower())
42 40
    return maps
43 41

  
src/temis_color_tables.py
1 1
#!/usr/bin/env python3
2 2

  
3 3
import numpy as np
4
from matplotlib import pyplot as plt
4 5
from matplotlib.colors import LinearSegmentedColormap
5 6
from matplotlib import cm
6 7

  
7 8
# As used on the poster (2017).
8
colormaps_names = list(cm.datad.keys())                                                                                                                                                                         
9
colormaps_names.extend(list(cm.cmap_d.keys()))
10
colormaps_names = set(colormaps_names)
9
colormaps_names = set(plt.colormaps())
11 10

  
12 11
if 'no2_special' not in colormaps_names:
13 12
    segmentdata = [(0.0, 0.0, 190/255), # dark-blue

Also available in: Unified diff