gpt4 book ai didi

r - 更改刻度标签中的逗号和千位分隔符

转载 作者:行者123 更新时间:2023-12-01 00:32:50 25 4
gpt4 key购买 nike

在像下面这样的图表中,我想将千位分隔符更改为点“.”,但我不知道如何使用 tickformat参数以获取它。

require(plotly)
p <- plot_ly(x=~c(2012,2013,2014,2015,2016), y=~c(1200000,975000,1420000,1175000,1360000), type='bar') %>%
layout(yaxis = list(title="Income in €", tickformat=",d", gridcolor = "#bbb"), xaxis = list(title="Year"), margin=list(l=80))
p

enter image description here

最佳答案

据我所知,如果你使用 tickformat , separators 被忽略。所以你可以指定你的 tickformat或您的 separators .

require(plotly)
p <- plot_ly(x=~c(2012, 2013, 2014, 2015, 2016), y=~c(1200000, 975000, 1420000, 1175000, 1360000), type = 'bar') %>%
layout(separators = '.,',
yaxis = list(title='Income in Euro'))
p

enter image description here

关于r - 更改刻度标签中的逗号和千位分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43436009/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com