Format axis tick labels to percentage in plotly

后端 未结 2 462
野趣味
野趣味 2020-12-20 12:16

I am creating bar charts in plotly with y-axis representing percentages or shares within 0-1. The y-axis displays as 0.05 instead of 5.0%.

Is there a way

2条回答
  •  离开以前
    2020-12-20 12:41

    The plotly documentation directs us to this page which has a comprehensive list of available formatting options.

    In this case, formatting percentages like 5%, tickformat='%' should suffice. If you want to display decimal points too, then something like '.n%' would do the trick (replace n with desired number of digits after decimal point).

    The github page referenced above conatins many more formatting options. Cheers!

提交回复
热议问题