Invert color map

Hi,

Is it possible to inverse the color map I am using to show the higher value as dark green and blue. Snippet of code given below:

    mapper_w = LinearColorMapper(palette='Blues9', low=0, high=2)
    view_fd_w = CDSView(source=source_fd, filters=[tempInt_filter_fd, mon_filter, wn_filter, t_filter_fd, system_filter_w])
    pWS.rect(x="Date_time", y="Zone", 
                       source=source_fd, view=view_fd_w, 
                       width='w', height=1,
                       fill_color={'field': 'Fnorm', 'transform': mapper_w},
                       line_color=None)
        
    color_bar = ColorBar(color_mapper=mapper_w, major_label_text_font_size="16px",
                     ticker=BasicTicker(desired_num_ticks=2),
                     formatter=PrintfTickFormatter(format="%5.1f"),
                     label_standoff=6, border_line_color=None, location=(0, 0))

Any Bokeh colormap cmap can be inverted as cmap[::-1], though that won’t work with functions.

1 Like