Legends with multiple columns? Two legends below plot?

Hi,

Is there anyway to have a legend with multiple columns? I saw some discussion on this before, and that currently it was not supported and was not a priority. Is this true? As a workaround, I create two separate legends and place them below the plot. The problem is that when I do plot.add_layout(layout_location=‘below’,…), then the first legend is below the plot as expected. However, the second legend is then placed below the first. Playing with the location parameter of the Legend object, I can make the two legends appear directly below the plot and side by side. This has the unfortunate side effect of creating a lot of whitespace below the two legends. If I then decide to add a DataTable as a widget below the plot, it is separated from the plot by a lot of whitespace.

It would be nice to have multiple columns in a legend, or to be able to add the legends to the ‘bokeh.layouts’ object. Then in my case I’d have: [[plot],[legend1, legend2], [datatable]].

Any advice on how I can have two legends or a single legend with multiple columns below my main plot without creating tons of white space?

Thanks,

Justin

Hi,

···

On Tue, Oct 10, 2017 at 5:09 AM, [email protected] wrote:

Hi,

Is there anyway to have a legend with multiple columns? I saw some discussion on this before, and that currently it was not supported and was not a priority. Is this true? As a workaround, I create two separate legends and place them below the plot. The problem is that when I do plot.add_layout(layout_location=‘below’,…), then the first legend is below the plot as expected. However, the second legend is then placed below the first. Playing with the location parameter of the Legend object, I can make the two legends appear directly below the plot and side by side. This has the unfortunate side effect of creating a lot of whitespace below the two legends. If I then decide to add a DataTable as a widget below the plot, it is separated from the plot by a lot of whitespace.

It would be nice to have multiple columns in a legend, or to be able to add the legends to the ‘bokeh.layouts’ object. Then in my case I’d have: [[plot],[legend1, legend2], [datatable]].

Any advice on how I can have two legends or a single legend with multiple columns below my main plot without creating tons of white space?

currently neither multi-column legends nor placing multiple legends side-by-side is possible (at least officially and without hacks). However, there is ongoing work in this area on a much broader feature regarding positioning of entities on canvas, so both features will be a available at some point as a side effect (possibly as soon as 0.12.11). There is also ongoing discussion about off-canvas legends, that would allow things like layout( [[plot],[legend1, legend2], [datatable]]), but that’s much more far-off.

Mateusz

Thanks,

Justin

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/be4ddd71-ab23-4422-8951-1bc97b5d95a7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.