Producing conditional (if) plots


I’m new at Bokeh.

I have a dataset composed of rows and features, from which I should generate plots, but with the option of selecting the feature, that gives the color scale to the plot. The thing is almost all of my features are real, but I have one of them which is binary (1s and 0s). And I want to produce a special plot for it, where I could be able of hiding 0s and showing 1s, and viceversa.

My initial idea was to condition the selection of feature, if it’s the binary feature, it creates a plot of two colors. While if it’s a real feature, it plots using linear_cmap. But when I change from the binary feature to any of the real feature, the plot disappears.

Do you have any idea of how I could generate this conditional plots?

Thanks in advance.
Kind regards.


If you could post a minimal example with a sample dataset (if possible), that’d be great. I think it’s a straightforward way to solve it but a minimal example would make the process easier :slight_smile: