☰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

Bokeh Legend Orientation Horizontal

Community Support
Pragyan_Bezbaruah
Pragyan_Bezbaruah

Here is the sample code -

p = Bar(df, values=blend(‘M1’,‘M2’,‘M3’,‘M4’,‘P1’,‘P2’,‘P3’,‘P4’,
name=‘Severity Count’, labels_name=‘severity’),
label=cat(columns=‘Code’,
sort=False), stack=cat(columns=‘severity’),
legend=‘top_right’, title=‘Check if any Particular Code leads to a specific severity’, plot_width=1100,
plot_height=600, tools=“wheel_zoom,pan,reset,resize,save”,
color=[’#87CEFA’,’#9BC4E2’,’#6CA6CD’,’#325C74’,’#EE7942’,’#CD6839’,’#8A360F’,’#5C4033’], webgl=True)

How can we make the legend horizontal? I have got a lot of examples where the data is given on the code or something similar but not something like this. I want to give the orientation command inside Bar itself. Can it be done?

If not, it is hard for me to map the columns with the Legends.

⌁   Link to post
birdsarah_continuum
birdsarah_continuum

It is not possible to pass the legend orientation into the Bar call. But you should be able to change it once you’ve created the Bar by grabbing the legend and change its orientation.

Sarah Bird
sbird@continuum.io

···

On Jul 26, 2016, at 6:51 AM, Pragyan Bezbaruah pragyanbezbo@gmail.com wrote:

Here is the sample code -

p = Bar(df, values=blend(‘M1’,‘M2’,‘M3’,‘M4’,‘P1’,‘P2’,‘P3’,‘P4’,
name=‘Severity Count’, labels_name=‘severity’),
label=cat(columns=‘Code’,
sort=False), stack=cat(columns=‘severity’),
legend=‘top_right’, title=‘Check if any Particular Code leads to a specific severity’, plot_width=1100,
plot_height=600, tools=“wheel_zoom,pan,reset,resize,save”,
color=[‘#87CEFA’,‘#9BC4E2’,‘#6CA6CD’,‘#325C74’,‘#EE7942’,‘#CD6839’,‘#8A360F’,‘#5C4033’], webgl=True)

How can we make the legend horizontal? I have got a lot of examples where the data is given on the code or something similar but not something like this. I want to give the orientation command inside Bar itself. Can it be done?

If not, it is hard for me to map the columns with the Legends.

–

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 bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7f101142-6b8e-41d3-8d41-3e5870478df7%40continuum.io.

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

⌁   Link to post
Pragyan_Bezbaruah
Pragyan_Bezbaruah

Yeah maybe.

Let me try it out today. Will let you know either way. :slight_smile:
thanks.

···

On Tuesday, July 26, 2016 at 8:01:05 PM UTC+5:30, Sarah Bird wrote:

It is not possible to pass the legend orientation into the Bar call. But you should be able to change it once you’ve created the Bar by grabbing the legend and change its orientation.

Sarah Bird
sb...@continuum.io

On Jul 26, 2016, at 6:51 AM, Pragyan Bezbaruah pragya...@gmail.com wrote:

Here is the sample code -

p = Bar(df, values=blend(‘M1’,‘M2’,‘M3’,‘M4’,‘P1’,‘P2’,‘P3’,‘P4’,
name=‘Severity Count’, labels_name=‘severity’),
label=cat(columns=‘Code’,
sort=False), stack=cat(columns=‘severity’),
legend=‘top_right’, title=‘Check if any Particular Code leads to a specific severity’, plot_width=1100,
plot_height=600, tools=“wheel_zoom,pan,reset,resize,save”,
color=[‘#87CEFA’,‘#9BC4E2’,‘#6CA6CD’,‘#325C74’,‘#EE7942’,‘#CD6839’,‘#8A360F’,‘#5C4033’], webgl=True)

How can we make the legend horizontal? I have got a lot of examples where the data is given on the code or something similar but not something like this. I want to give the orientation command inside Bar itself. Can it be done?

If not, it is hard for me to map the columns with the Legends.

–

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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7f101142-6b8e-41d3-8d41-3e5870478df7%40continuum.io.

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

⌁   Link to post

End of archived discussion · Replies are disabled