我正在尝试格式化y axis
数字的格式(in plotly
)并且 - 经过数小时的谷歌搜索 - 我决定在这里问。
我有一个像这里的情节:
使用此代码生成:
library("plotly")
library("dplyr")
data.frame(miesiac_label = as.character(as.roman(c(1:12))),
ile = c(12000, 12100, 11100, 12000, 12000, 11900, 12200, 12100, 6000, 12100, 12100, 12100)) -> dane
dane$miesiac_label <- factor(dane$miesiac_label, levels = dane[["miesiac_label"]])
plot_ly(dane) %>%
add_trace(x = ~miesiac_label, y = ~ile,
type = 'bar', marker = list(color = '#99d3df'))
我的目标是将yaxis
格式从更改12k, 10k, 8k, ...
为更“抛光”,因此12 tys, 10 tys, 8 tys, ...
. 我知道如何更改它的设置ticktext
,ticktext
但我不想自己设置值,我更喜欢让它们更自动。
我已经阅读过thickformat
但我没有找到该选项,该选项将更k
改为tys
.
谢谢你的帮助!