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

后端 未结 5 837
轮回少年
轮回少年 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:39

    The way I dealt with this in Python was to simply add a line break and then whitespace and you can essentially have a blank line that creates the separation. Hacky, but it works. You can see it in the second line.

     yaxis=go.layout.YAxis(
        title_text="Number of Articles
    ", titlefont=dict(size=12)), paper_bgcolor="white", title=go.layout.Title( xref="paper", x=0.5 )

    Before:

    Before

    After:

    After

提交回复
热议问题