Is it possible to change the orientation of group text in a CategoricalAxis?

Hello!

I have a plot similar to this one:

https://bokeh.pydata.org/en/latest/docs/gallery/bar_nested_colormapped.html

and I’d like to hide the major labels (2015, 2016, 2017) and tilt group_text (Apples, Pears, …) since in my case they are longer and are overlapping each other.

I’ve hidden major labels with p.xaxis.major_label_text_color = None but can’t find the way to tilt the group_text. I need something like p.xaxis.group_name_orientation = 1.2

Thanks in advance for your help.

Hi,

This is not currently possible, the group labels are always parallel. Extending that would be a nice constrained task that would be good or a new contributor. In any case, a GitHub feature request is the appropriate next step:

  https://github.com/bokeh/bokeh/issues

Thanks,

Bryan

···

On Oct 17, 2017, at 06:27, Esti Alvarez <[email protected]> wrote:

Hello!

I have a plot similar to this one:

https://bokeh.pydata.org/en/latest/docs/gallery/bar_nested_colormapped.html

and I'd like to hide the major labels (2015, 2016, 2017) and tilt group_text (Apples, Pears, ...) since in my case they are longer and are overlapping each other.

I've hidden major labels with p.xaxis.major_label_text_color = None but can't find the way to tilt the group_text. I need something like p.xaxis.group_name_orientation = 1.2

Thanks in advance for your help.

--
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/7c72b75f-55e1-49b3-977e-f04f95c0f88d%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you, Bryan,

For the moment, if there is no workaround, I may try using some abreviated names for my labels.

And a way to get a legend with the values of the years?

I got both things “out of the box” when I used the old bkcharts package with something like:

p = Bar(source.data, values=‘counts’, label=[‘fruits’], group=‘year’, legend=“top_right”…)

``

so I’m thinking this should be possible using basic glyphs. I need to rewrite my old chart because I updated Bokeh to get rid of errors in IE11 elsewhere, and with bokeh 0.12.10rc2 I get this error when trying to import Bar from bkcharts:

File “init.py”, line 5, in :
from bokeh.plotting.helpers import DEFAULT_PALETTE; DEFAULT_PALETTE Traceback (most recent call last):
File “/home/hcoop/anaconda3/envs/hcoop/lib/python3.5/site-packages/bokeh/application/handlers/code_runner.py”, line 125, in run
exec(self._code, module.dict)
File “/web/hcoop_staging/bokeh_server/subsidizers.py”, line 4, in
from bkcharts import Bar
File “/home/hcoop/anaconda3/envs/hcoop/lib/python3.5/site-packages/bkcharts/init.py”, line 5, in
from bokeh.plotting.helpers import DEFAULT_PALETTE; DEFAULT_PALETTE
ImportError: cannot import name ‘DEFAULT_PALETTE’

``

Thanks again for the help!

···

On Tuesday, October 17, 2017 at 3:54:08 PM UTC+2, Bryan Van de ven wrote:

Hi,

This is not currently possible, the group labels are always parallel. Extending that would be a nice constrained task that would be good or a new contributor. In any case, a GitHub feature request is the appropriate next step:

    [https://github.com/bokeh/bokeh/issues](https://github.com/bokeh/bokeh/issues)

Thanks,

Bryan

On Oct 17, 2017, at 06:27, Esti Alvarez [email protected] wrote:

Hello!

I have a plot similar to this one:

https://bokeh.pydata.org/en/latest/docs/gallery/bar_nested_colormapped.html

and I’d like to hide the major labels (2015, 2016, 2017) and tilt group_text (Apples, Pears, …) since in my case they are longer and are overlapping each other.

I’ve hidden major labels with p.xaxis.major_label_text_color = None but can’t find the way to tilt the group_text. I need something like p.xaxis.group_name_orientation = 1.2

Thanks in advance for your help.


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/7c72b75f-55e1-49b3-977e-f04f95c0f88d%40continuum.io.

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

Hi,

There are lots of examples with legends here:

  http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html

I would recommend studying that section first to see if it answers your question first.

Re: "Bar" it is now part of the separate "bkcharts" package. It is no longer part of core Bokeh. You may have success installing bkcharts explicitly, but quite possibly not. bkcharts is unsupported and maintained. I would not recommend anyone use it at this point.

Thanks,

Bryan

···

On Oct 17, 2017, at 10:07, Esti Alvarez <[email protected]> wrote:

Thank you, Bryan,

For the moment, if there is no workaround, I may try using some abreviated names for my labels.

And a way to get a legend with the values of the years?

I got both things "out of the box" when I used the old bkcharts package with something like:

p = Bar(source.data, values='counts', label=['fruits'], group='year', legend="top_right"...)

so I'm thinking this should be possible using basic glyphs. I need to rewrite my old chart because I updated Bokeh to get rid of errors in IE11 elsewhere, and with bokeh 0.12.10rc2 I get this error when trying to import Bar from bkcharts:

File "__init__.py", line 5, in <module>:
from bokeh.plotting.helpers import DEFAULT_PALETTE; DEFAULT_PALETTE Traceback (most recent call last):
  File "/home/hcoop/anaconda3/envs/hcoop/lib/python3.5/site-packages/bokeh/application/handlers/code_runner.py", line 125, in run
    exec(self._code, module.__dict__)
  File "/web/hcoop_staging/bokeh_server/subsidizers.py", line 4, in <module>
    from bkcharts import Bar
  File "/home/hcoop/anaconda3/envs/hcoop/lib/python3.5/site-packages/bkcharts/__init__.py", line 5, in <module>
    from bokeh.plotting.helpers import DEFAULT_PALETTE; DEFAULT_PALETTE
ImportError: cannot import name 'DEFAULT_PALETTE'

Thanks again for the help!

On Tuesday, October 17, 2017 at 3:54:08 PM UTC+2, Bryan Van de ven wrote:
Hi,

This is not currently possible, the group labels are always parallel. Extending that would be a nice constrained task that would be good or a new contributor. In any case, a GitHub feature request is the appropriate next step:

        https://github.com/bokeh/bokeh/issues

Thanks,

Bryan

> On Oct 17, 2017, at 06:27, Esti Alvarez <[email protected]> wrote:
>
> Hello!
>
> I have a plot similar to this one:
>
> https://bokeh.pydata.org/en/latest/docs/gallery/bar_nested_colormapped.html
>
> and I'd like to hide the major labels (2015, 2016, 2017) and tilt group_text (Apples, Pears, ...) since in my case they are longer and are overlapping each other.
>
> I've hidden major labels with p.xaxis.major_label_text_color = None but can't find the way to tilt the group_text. I need something like p.xaxis.group_name_orientation = 1.2
>
> Thanks in advance for your help.
>
> --
> 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/7c72b75f-55e1-49b3-977e-f04f95c0f88d%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
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/636c1d69-17c4-4a7e-a687-221e69a636d4%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.