@@ -953,11 +953,11 @@ def _update_color_cycle(key, value):
953953 else :
954954 cycle , rgbcycle = value , rc_quick ['rgbcycle' ]
955955 try :
956- colors = pcolors ._cmapdict [cycle ].colors
956+ colors = pcolors ._cmap_database [cycle ].colors
957957 except (KeyError , AttributeError ):
958958 return {}, {}, {}
959959 cycles = sorted (
960- name for name , cmap in pcolors ._cmapdict .items ()
960+ name for name , cmap in pcolors ._cmap_database .items ()
961961 if isinstance (cmap , pcolors .ListedColormap )
962962 )
963963 raise ValueError (
@@ -1217,7 +1217,7 @@ def register_cmaps(user=True, default=False):
12171217 'phase' , 'graycycle' , 'romao' , 'broco' , 'corko' , 'viko' ,
12181218 ):
12191219 cmap .set_cyclic (True )
1220- pcolors ._cmapdict [cmap .name ] = cmap
1220+ pcolors ._cmap_database [cmap .name ] = cmap
12211221
12221222
12231223@docstring .add_snippets
@@ -1241,7 +1241,7 @@ def register_cycles(user=True, default=False):
12411241 cmap = pcolors .ListedColormap .from_file (path , warn_on_failure = True )
12421242 if not cmap :
12431243 continue
1244- pcolors ._cmapdict [cmap .name ] = cmap
1244+ pcolors ._cmap_database [cmap .name ] = cmap
12451245
12461246
12471247@docstring .add_snippets
@@ -1418,10 +1418,13 @@ def register_fonts():
14181418 os .environ ['TTFPATH' ] += ':' + paths
14191419 mfonts ._rebuild ()
14201420
1421- # Remove ttc files *after* rebuild
1421+ # Remove ttc files and 'Thin' fonts *after* rebuild
1422+ # NOTE: 'Thin' filter is ugly kludge but without this matplotlib picks up on
1423+ # Roboto thin ttf files installed on the RTD server when compiling docs.
14221424 mfonts .fontManager .ttflist = [
14231425 font for font in mfonts .fontManager .ttflist
14241426 if os .path .splitext (font .fname )[1 ] != '.ttc'
1427+ or 'Thin' in os .path .basename (font .fname )
14251428 ]
14261429
14271430
@@ -1441,10 +1444,10 @@ def register_fonts():
14411444
14421445# Convert colormaps that *should* be LinearSegmented from Listed
14431446for _name in ('viridis' , 'plasma' , 'inferno' , 'magma' , 'cividis' , 'twilight' ):
1444- _cmap = pcolors ._cmapdict .get (_name , None )
1447+ _cmap = pcolors ._cmap_database .get (_name , None )
14451448 if _cmap and isinstance (_cmap , pcolors .ListedColormap ):
1446- del pcolors ._cmapdict [_name ]
1447- pcolors ._cmapdict [_name ] = pcolors .LinearSegmentedColormap .from_list (
1449+ del pcolors ._cmap_database [_name ]
1450+ pcolors ._cmap_database [_name ] = pcolors .LinearSegmentedColormap .from_list (
14481451 _name , _cmap .colors , cyclic = (_name == 'twilight' )
14491452 )
14501453
@@ -1472,7 +1475,7 @@ def register_fonts():
14721475# image.lut. We have to register colormaps and cycles first so that the 'cycle'
14731476# property accepts named cycles registered by ProPlot. No performance hit here.
14741477lut = rc ['image.lut' ]
1475- for cmap in pcolors ._cmapdict .values ():
1478+ for cmap in pcolors ._cmap_database .values ():
14761479 if isinstance (cmap , mcolors .LinearSegmentedColormap ):
14771480 cmap .N = lut
14781481
0 commit comments