bokeh/rbokeh

axis_label_text_font_size in theme_axis does not respond

bdpiccolo opened this issue · 2 comments

The axis_label_text_font_size does not seem to respond to my input. However, major_label_text_font_size does.

figure() %>%
  ly_points(1:10) %>%
  theme_axis(c("x", "y"), 
	axis_label_text_font_size = "25pt",
	major_label_text_font_size = "25pt")

bokeh_plot

Running rbokeh_0.5.0 on R version 3.5.1.

Have not tried the development version as my work's firewall doesn't allow me to install from github.

Keep up the good work!

Confirmed. It looks like the font_size values are correctly passed as attributes, but not used to render the plot. Instead, for major labels, rendering is done using the axis_label_text_font_size attribute.
A dirty hack could be to modify the plot object manually (line bkf$x$spec$theme$axis$axis_label_text_font_size = "30pt" below). It will apply to both x and y.

bkf = figure() %>%
     ly_points(1:10) %>%
     theme_axis(c("x", "y"), 
                axis_label_text_font_size = "20pt",
                major_label_text_font_size = "20pt")

## check values
bkf$x$spec$model$x_axis$attributes
bkf$y$spec$model$y_axis$attributes
## render plot
bkf
## check axis_label_text_font_size value
bkf$x$spec$theme$axis$axis_label_text_font_size
## modify
bkf$x$spec$theme$axis$axis_label_text_font_size = "30pt"
## render plot
bkf

I have this same problem with axis_label_text_font_size.
You help me a lot with the label font size.
Thank you.