☰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

Plotting decision boundaries

Community Support
kylrth
kylrth

I’d like to be able to reproduce this plot from matplotlib:

output

The background is the decision boundary for an SVM trained on the data. I can use figure.image to render the np.meshgrid object in Bokeh:

capture

It would obviously interact faster and fill the entire page if I could use an annotation instead. The closest thing I found was a BoxAnnotation, but as far as I could see there is no way to angle the boundaries. Any thoughts on how to plot an angled decision boundary like this?

⌁   Link to post
Bryan
Bryan

@kylrth Your best best is plot.patch or plot.patches glyphs. There is no annotation that will draw an “infinite division with angled boundary” at present. There is a Slope annotation that will draw a single infinite sloped line, but it does not fill the opposing sides. That seems like a reasonable ask (and probably simple/good new first issue) if you want to make a GitHub issue to request it.

⌁   Link to post

End of archived discussion · Replies are disabled