Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Legend on multiple columns with Bokeh Charts

Tags:

python

bokeh

I am trying to set the number of columns in the legend using bokeh. Using matplotlib there is a simple keyword ncol but I cannot find a way to do it in bokeh.

Any help appreciated.

like image 730
dibus2 Avatar asked Dec 06 '25 19:12

dibus2


1 Answers

As of Bokeh 0.12.3 Bokeh legends only support complete orientations 'horizontal' or 'vertical':

http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#orientation

So you could have a legend arranged horizontally in one row and several columns, by doing

plot.legend.orientation = "horizontal"

But there is not any way to have e.g. a legend with two rows by two columns. There is an open issue on GitHub to add this capability as a feature.

like image 200
bigreddot Avatar answered Dec 09 '25 13:12

bigreddot