☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Failed to use matplotlib colormap in bokeh image

Community Support
ahmettemiz88
ahmettemiz88

I failed to use matplotlib colormap in bokeh image

When I try:

from matplotlib import cm
cmap = cm.get_cmap('hot', 256)

p.image(image='image', x=minX_dep, y=minY_dep, 
        dw=(maxX_dep-minX_dep ), dh=( maxY_dep-minY_dep) ,     
        global_alpha=0.5 , source=source, 
        color_mapper=cmap)   #  cmap doesn't fit here

how can I use matplotlib’s cmap in bokeh’s image?
OR
Is there any other solution to use colorpalette(hot) ?

regards

⌁   Link to post
Bryan
Bryan

Bokeh palettes are lists of RGB hex strings, e.g. "#ffb3e2", you will need to convert whatever format the MPL palette is in to that. You may also find there is an existing built-in palette that suits your needs:

Lastly, to help others help you, please always format code snippets, either using the GUI </> button or by enclosing in triple backticks ``` (I’ve edited your post).

⌁   Link to post

End of archived discussion · Replies are disabled