Bokeh Legend Orientation Horizontal

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.

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
[email protected]

···

On Jul 26, 2016, at 6:51 AM, Pragyan Bezbaruah [email protected] 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 [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/7f101142-6b8e-41d3-8d41-3e5870478df7%40continuum.io.

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

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
[email protected]

On Jul 26, 2016, at 6:51 AM, Pragyan Bezbaruah [email protected] 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 [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/7f101142-6b8e-41d3-8d41-3e5870478df7%40continuum.io.

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