How to set the width of a legend

Hi everyone,

I have different plots with legends outside the plot area (see Redirecting to Google Groups). It turns out that the length of the text in the legend determines what the width of the pie chart will be: longer text, narrower pie; shorter text, wider chart.

I’d like the charts to be uniform so I would like to be able to specify that the legend should be, say, 20% of the plot area. Is that possible?

Thank you in advance!

1 Like

Hi,

As far as I can tell, the legend width is not directly configurable. However, you can specify the label width. The defalt is 20 which is fairly low, if you increase that to a size that will encompass your largest legend label anywhere, and set all legends to have that same label length then I think things would line up. Otherwise, feel free to open a GitHub issue to discuss supporting this use case better.

Thanks,

Bryan

···

On Jul 18, 2017, at 06:24, Esti Alvarez <[email protected]> wrote:

Hi everyone,

I have different plots with legends outside the plot area (see Redirecting to Google Groups). It turns out that the length of the text in the legend determines what the width of the pie chart will be: longer text, narrower pie; shorter text, wider chart.

I'd like the charts to be uniform so I would like to be able to specify that the legend should be, say, 20% of the plot area. Is that possible?

Thank you in advance!

--
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/4144f63e-8c7b-4550-98d8-e5756da660b5%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

1 Like

Hi Bryan

The label_width parameter did the job.

Thank you!

···

On Tuesday, July 18, 2017 at 5:25:09 PM UTC+2, Bryan Van de ven wrote:

Hi,

As far as I can tell, the legend width is not directly configurable. However, you can specify the label width. The defalt is 20 which is fairly low, if you increase that to a size that will encompass your largest legend label anywhere, and set all legends to have that same label length then I think things would line up. Otherwise, feel free to open a GitHub issue to discuss supporting this use case better.

Thanks,

Bryan

On Jul 18, 2017, at 06:24, Esti Alvarez [email protected] wrote:

Hi everyone,

I have different plots with legends outside the plot area (see https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/legend/bokeh/uEliQlgj390/7iFufoaTAAAJ). It turns out that the length of the text in the legend determines what the width of the pie chart will be: longer text, narrower pie; shorter text, wider chart.

I’d like the charts to be uniform so I would like to be able to specify that the legend should be, say, 20% of the plot area. Is that possible?

Thank you in advance!


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/4144f63e-8c7b-4550-98d8-e5756da660b5%40continuum.io.

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