Adjust the font size of the bokeh shape

How to set the caption font size for a figure when using bokeh?

I tried (on ipython laptop):

import bokeh.plotting as bp import numpy as np bp.output_notebook() x_points = np.random.rand(100) y_points = np.random.rand(100) bp.figure(title='My Title', x_axis_label='X axis', y_axis_label='Y axis', \ text_font_size='8pt') bp.scatter(x_points, y_points) bp.show() 

I tried text_font_size, label_text_font, title_font_size, etc. Where in the documentation is all this information?

+11
python bokeh
source share
2 answers

I get it. You need to add "title_" to "text_font_size"

 import bokeh.plotting as bp import numpy as np bp.output_notebook() x_points = np.random.rand(100) y_points = np.random.rand(100) bp.figure(title='My Title', x_axis_label='X axis', y_axis_label='Y axis', \ title_text_font_size='8pt') bp.scatter(x_points, y_points) bp.show() 
+10
source share

The title_text_font_size graph property title_text_font_size been deprecated at 0.12.0 and will be removed. Starting with bokeh version 0.12.0, use Plot.title.text_font_size . Below is an example below:

 import numpy as np import bokeh.plotting as bp bp.output_notebook() x_points = np.random.rand(100) y_points = np.random.rand(100) p = bp.figure(title='My Title', x_axis_label='X axis', y_axis_label='Y axis') p.title.text_font_size = '8pt' p.scatter(x_points, y_points) bp.show(p) 

Similarly, you can change the font size of the axis labels:

 p.xaxis.axis_label_text_font_size = "20pt" p.yaxis.axis_label_text_font_size = "20pt" 
+17
source share

All Articles