I am new to bokeh and I'm trying to plot some data in a line plot. The x-axis, y-axis and thus the ticks should have a different size than default.
Here is an example of my code:
from bokeh.plotting import figure, show
from bokeh.models import Legend, LinearAxis
import numpy as np
x = list(range(10))
y = list(range(10))
plot = figure(plot_width=900, plot_height=600)
plot.xaxis.axis_label="xaxis_name"
plot.xaxis.axis_label_text_font_size = "25pt"
plot.xaxis.axis_label_text_font = "times"
plot.xaxis.axis_label_text_color = "black"
plot.yaxis.axis_label="yaxis_name"
plot.yaxis.axis_label_text_font_size = "25pt"
plot.yaxis.axis_label_text_font = "times"
plot.yaxis.axis_label_text_color = "black"
plot.line( x, y, line_width=4, line_color='red', legend="arbitrary_line" )
plot.legend.location = "top_left"
plot.legend.label_text_font_size = "21pt"
plot.legend.label_text_font = "times"
plot.legend.label_text_color = "black"
show(plot)
This is what the output looks like:
The data is made up for this example but the idea is the same. Please note that in the current plot there is a big size different between the x axis label text and the tick numbers. All I want is to set a different size to tick labels. Any insight would be appreciated.
axses have similar attributes for the major and minor tick sizes. For the major ticks are 'major_label_text_font_size'. Read the rest of the attributes at https://docs.bokeh.org/en/latest/docs/reference/models/axes.html.
from bokeh.plotting import figure, show
from bokeh.models import Legend, LinearAxis
import numpy as np
x = list(range(10))
y = list(range(10))
plot = figure(plot_width=900, plot_height=600)
plot.xaxis.axis_label="xaxis_name"
plot.xaxis.axis_label_text_font_size = "25pt"
plot.xaxis.major_label_text_font_size = "25pt"
plot.xaxis.axis_label_text_font = "times"
plot.xaxis.axis_label_text_color = "black"
plot.yaxis.axis_label="yaxis_name"
plot.yaxis.axis_label_text_font_size = "25pt"
plot.yaxis.major_label_text_font_size = "25pt"
plot.yaxis.axis_label_text_font = "times"
plot.yaxis.axis_label_text_color = "black"
plot.line( x, y, line_width=4, line_color='red', legend="arbitrary_line" )
plot.legend.location = "top_left"
plot.legend.label_text_font_size = "21pt"
plot.legend.label_text_font = "times"
plot.legend.label_text_color = "black"
show(plot)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With