x-axis label tick size s for bar charts

How to change x-axis label ticks for bar charts? The font is taking up too much space and overlapping it, either change the spacing or change the size.

Styling the tick labels is always a matter of:

* getting the axis object
* setting attribute on the axis object

Right now it's a little harder to get the axis you might want off a chart. The Figure class has some nice convenience methods like .xaxis, etc. These should probably be added to Chart as well. (This would make a nice task for a new contributor). For now, to get the x-xaxis off a chart, it should work to look at the .below property of the chart, which is where the axis is normally stored:

  In [22]: mychart.below
  Out[22]: [<bokeh.models.axes.LinearAxis at 0x10cb494a8>]

Once you have the axis, you can style it in the same way as described in

  Appearance — Bokeh 3.3.2 Documentation

I will say that improving layout is a very high current priority for us, it is possible that the .below property will be deprecated soon. But not without adding in .xaxis, etc. to Chart first.

Thanks,

Bryan

···

On Feb 19, 2016, at 9:28 PM, [email protected] wrote:

How to change x-axis label ticks for bar charts? The font is taking up too much space and overlapping it, either change the spacing or change the size.

--
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/d76c564d-ce7f-4312-815a-09f56fc02192%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

You can access charts x and y axis via _xaxis and _yaxis for now. Aligning Chart with Figure is in our roadmap so you should then be able to just use the same standard way.

Fabio

···

On Sat, Feb 20, 2016 at 8:32 AM, Bryan Van de Ven [email protected] wrote:

Styling the tick labels is always a matter of:

  • getting the axis object

  • setting attribute on the axis object

Right now it’s a little harder to get the axis you might want off a chart. The Figure class has some nice convenience methods like .xaxis, etc. These should probably be added to Chart as well. (This would make a nice task for a new contributor). For now, to get the x-xaxis off a chart, it should work to look at the .below property of the chart, which is where the axis is normally stored:

    In [22]: mychart.below

    Out[22]: [<bokeh.models.axes.LinearAxis at 0x10cb494a8>]

Once you have the axis, you can style it in the same way as described in

    [http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#axes](http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#axes)

I will say that improving layout is a very high current priority for us, it is possible that the .below property will be deprecated soon. But not without adding in .xaxis, etc. to Chart first.

Thanks,

Bryan

On Feb 19, 2016, at 9:28 PM, [email protected] wrote:

How to change x-axis label ticks for bar charts? The font is taking up too much space and overlapping it, either change the spacing or change the size.

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/d76c564d-ce7f-4312-815a-09f56fc02192%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/E2257F01-A20A-4ED2-B5EF-24ABF6D35DFF%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Fabio Pliger

Senior Software Engineer, Bokeh

I’m sorry i’m not immediately clear on how this translates into actual code, it seems very hackish. I’ll just look at another library for now.

···

On Friday, February 19, 2016 at 6:29:55 PM UTC-8, donot want wrote:

How to change x-axis label ticks for bar charts? The font is taking up too much space and overlapping it, either change the spacing or change the size.

If Bokeh does not suit your needs, that's fine, it can't be all things to all people. I certainly wouldn't discourage anyone from using whatever tool works for you. However, comments like "it seems very hackish" are not helpful, nor appreciated.

Bryan

···

On Feb 20, 2016, at 3:07 PM, donot want <[email protected]> wrote:

I'm sorry i'm not immediately clear on how this translates into actual code, it seems very hackish. I'll just look at another library for now.

Hi Bryan,

I created this issue to track: https://github.com/bokeh/bokeh/issues/3908

There are a few design decisions that need to be made before this is implemented. If you could weigh in on this, I’d be happy to make a PR.

thanks,

Dennis

···

On Sat, Feb 20, 2016 at 2:54 PM Bryan Van de Ven [email protected] wrote:

On Feb 20, 2016, at 3:07 PM, donot want [email protected] wrote:

I’m sorry i’m not immediately clear on how this translates into actual code, it seems very hackish. I’ll just look at another library for now.

If Bokeh does not suit your needs, that’s fine, it can’t be all things to all people. I certainly wouldn’t discourage anyone from using whatever tool works for you. However, comments like “it seems very hackish” are not helpful, nor appreciated.

Bryan

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/861B609E-DBDF-4314-8EDB-42CC0FC24765%40continuum.io.

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

FYI, I’ve added more contextual info to the related issue.

As for the _xaxis and _yaxis names, they are not “hackish” at all, just happen to be “private” names (or say just naming conventions…) but can be used in this specific use case.

···

On Sunday, February 21, 2016 at 12:18:22 PM UTC-6, Dennis O’Brien wrote:

Hi Bryan,

I created this issue to track: https://github.com/bokeh/bokeh/issues/3908

There are a few design decisions that need to be made before this is implemented. If you could weigh in on this, I’d be happy to make a PR.

thanks,

Dennis

On Sat, Feb 20, 2016 at 2:54 PM Bryan Van de Ven [email protected] wrote:

On Feb 20, 2016, at 3:07 PM, donot want [email protected] wrote:

I’m sorry i’m not immediately clear on how this translates into actual code, it seems very hackish. I’ll just look at another library for now.

If Bokeh does not suit your needs, that’s fine, it can’t be all things to all people. I certainly wouldn’t discourage anyone from using whatever tool works for you. However, comments like “it seems very hackish” are not helpful, nor appreciated.

Bryan

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/861B609E-DBDF-4314-8EDB-42CC0FC24765%40continuum.io.

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