Open bsherin opened 3 months ago
essentially instead of using
cmap=get_cmap(self.color_palette)
I need to have
cmap = matplotlib.colormaps[self.palette_name]
In d3 tiles I'll need to use palette_to_hex. In some tiles this appears as an extra method. But now the D3Tile class has this built in as:
def palette_to_hex(self, cmap, num):
step = 1.0 / num
cmap = mpl.colormaps[self.palette_name]
breaks = [i * step for i in range(num)]
return [rgb2hex(cmap(bb)) for bb in breaks]
Should probably also document how to use palettes.
See D3DiscussionHeatmapPortal