Plotly R: setting the spacing between axis label and axis ticks labels

后端 未结 5 838
轮回少年
轮回少年 2021-02-14 04:58

Is there any way to set a spacing between axis labels and axis ticks labels other than changing margins?

Example plot:

plot_ly(mtcars, x = ~ wt, y = ~ pa         


        
5条回答
  •  甜味超标
    2021-02-14 05:30

    you can try to modify the margins by adding them to your graph like this:

    m <- list(l=150, r=20, b=10, t=10) # l = left; r = right; t = top; b = bottom
    plot_ly(mtcars, x = ~ wt, y = ~ paste0(hp, '0000')) %>% layout(margin=m)
    

    hope this helps?

提交回复
热议问题