Jonathan Shore Jonathan Shore - 3 months ago 38
Python Question

adjusting x_axis_label or y_axis_label font/font size (Bokeh)

Is there a way to adjust

x_axis_label
and
y_axis_label
font/font size in Bokeh (0.70)? I am aware of a way to adjust title font size with the
title_text_font_size
property, with:

figure (..., title_text_font_size="12pt")


Is there a way to then specify something like:

figure (..., x_axis_label_text_font_size='10pt')


(using the convention of
<name>
_text_font_size) to indicate the font size property. The above did not work. If this is not present, could someone give some pointers as to how to make this sort of adjustment in the cofeescript + API-side of things, so can contribute back to the project? Thanks

Answer

Figure exposes xaxis and yaxis attributes that you can use for that. In your use case it should be able to use:

p.xaxis.axis_label = 'whatever'
p.xaxis.axis_label_text_font_size = "40pt"