Search code examples
pythonbokeh

Python Bokeh plotting tool - Changing the font size of the ticker(both X and Y axis)


The problem which traps me is that I want to enlarge the font size in the ticker on both x and y-axis.

I am using the Bokeh as the tool for plotting. I can generate a neat plot now. But the ticker is way too small. As I went through google, I hardly find the solution. Huge thank. (Enlarge the font size within the red box)

enter image description here


Solution

  • You need the major_label_text_font_size attribute:

    from bokeh.io import show
    from bokeh.plotting import figure
    
    p = figure()
    p.circle(0, 0)
    p.xaxis.major_label_text_font_size = "20px"
    
    show(p)