修改y轴上的字体大小

时间:2018-12-31 01:42:42

标签: r plotly

当我尝试修改y轴标题时,它消失了。修改y轴刻度线就可以了。有人遇到过这个问题吗?谢谢!

library(plotly)
set.seed(2017)
x <- seq(1:10)
y <- x + rnorm(10)
plot_ly( x = ~x, y = ~y + rnorm(10)) %>%
     layout(
       xaxis = list(tickfont = list(size = 15)), 
       yaxis = list(tickfont = list(size = 25))) ## This works well.

 plot_ly( x = ~x, y = ~y + rnorm(10)) %>%
     layout(
       xaxis = list(tickfont = list(size = 15)), 
       yaxis = list(titlefont = list(size = 25))) ## This makes the y axis label disappear.

目标是修改y轴标题的大小,而不是使其全部消失。

1 个答案:

答案 0 :(得分:3)

似乎在这些情况下,还必须指定标题本身:

jQuery(function($) {...}

enter image description here