Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在R plotly中使用当前区域设置设置时间格式_R_Locale_Plotly_R Plotly - Fatal编程技术网

如何在R plotly中使用当前区域设置设置时间格式

如何在R plotly中使用当前区域设置设置时间格式,r,locale,plotly,r-plotly,R,Locale,Plotly,R Plotly,在R plotly中,如果我绘制基本时间序列: library(plotly) today <- Sys.Date() tm <- seq(0, 600, by = 10) x <- today - tm y <- rnorm(length(x)) plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) 我得到“28 mars 2019”,因为我所在的地区是法国。如何告诉p

在R plotly中,如果我绘制基本时间序列:

library(plotly)
today <- Sys.Date()
tm <- seq(0, 600, by = 10)
x <- today - tm
y <- rnorm(length(x))
plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today"))

我得到“28 mars 2019”,因为我所在的地区是法国。如何告诉plotly使用当前区域设置显示轴?例如,我想用“Avr 2018”而不是“Apr 2018”作为勾选标签。

您可以使用
config

plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) %>% config(locale = 'fr')
plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) %>% config(locale = 'fr')