R的绘图:当数据集包含大于1000的数字时,删除y轴上显示的k
嗨,这是一个关于plotly的“简单”问题,我想删除当数据集包含大于10000的数字时,似乎会自动出现在y轴上的k。我曾尝试将数据上传到plotly online,它也会输入“k” 例如,使用数据的子集R的绘图:当数据集包含大于1000的数字时,删除y轴上显示的k,r,plotly,R,Plotly,嗨,这是一个关于plotly的“简单”问题,我想删除当数据集包含大于10000的数字时,似乎会自动出现在y轴上的k。我曾尝试将数据上传到plotly online,它也会输入“k” 例如,使用数据的子集 date <- c(1/07/1987,2/07/1987,3/07/1987,4/07/1987, 5/07/1987,6/07/1987,7/07/1987,8/07/1987,9/07/1987, 10/07/1987,11/07/1987, 12/07/1987,13/07/198
date <- c(1/07/1987,2/07/1987,3/07/1987,4/07/1987,
5/07/1987,6/07/1987,7/07/1987,8/07/1987,9/07/1987,
10/07/1987,11/07/1987,
12/07/1987,13/07/1987,14/07/1987,15/07/1987,
16/07/1987,17/07/1987,18/07/1987,19/07/1987,
20/07/1987,21/07/1987,22/07/1987,23/07/1987,
24/07/1987,25/07/1987,26/07/1987,27/07/1987,
28/07/1987,29/07/1987,30/07/1987,31/07/1987,
1/08/1987,2/08/1987,3/08/1987)
inflow <- c(6763.37,
6117.23,5487.1,4964.52,
4514.75,4074.88,3708.87,
3433.5,3199.78,3039.32,3063.06,
2938.13,2701.71,2577.23,3333.21,
5549.01,9194.34,10773.31,12919.33,
19590.91,17501.189,15660.45,14296.71,
12260.04,10202.66,8973.64,7865.35,
7044.35,13550.44,9923.3,11974.07,
11349.38,10869.92,10350.58)
inflow_guaged <- cbind(date, inflow)
inflow_guaged$Data <- "2016"
colnames(inflow_guaged) <- c("date","inflow","Data")
m <- list(
l = 150,
r = 40,
b = 150,
t = 50,
pad = 0
)
f <- list(
family = "Courier New, monospace",
size = 18,
color = "#7f7f7f"
)
x <- list(
title = "Date",
titlefont = f
)
y <- list(
title = "Inflow (ML/d)",
titlefont = f
)
p <- plot_ly(data = inflows_type, x = date, y = inflow, color = Data, colors = "Set1") %>%
layout(xaxis = x, yaxis = y, margin = m )
datebei轴布局刚刚好
tickformat=“digit”或tickformat=“000”添加以下内容:
%>% layout(xaxis = list(tickformat = "digits"))
到您的绘图对象
因此,在您的情况下,应该是这样的:
x <- list(
title = "Date",
titlefont = f,
tickformat = "digits"
)
x您的日期不是要分析的引用字符串或已分析的日期;如果复制和粘贴正确,他们将被迫进行一些奇怪的双重。不过我想你需要准备一下,马上!这就是我所需要的,谢谢。关于它的作用以及为什么应该使用它,我有一些额外的解释。