def diverge_map(low=(239/255., 65/255., 50/255.),
high=(39/255., 184/255., 148/255.)):
"""Low and high are colors that will be used for the two
ends of the spectrum. they can be either color strings
or rgb color tuples
"""
c = mcolors.ColorConverter().to_rgb
if isinstance(low, basestring): low = c(low)
if isinstance(high, basestring): high = c(high)
return make_colormap([low, c('white'), 0.5, c('white'), high])
评论列表
文章目录