gpt4 book ai didi

r - 为 R : Remove the k that apears on the y axis when the dataset contains numbers larger than 1000 作图

转载 作者:行者123 更新时间:2023-12-04 02:09:44 25 4
gpt4 key购买 nike

嗨,关于 plotly 的“简单”问题,我想删除当数据集包含大于 10000 的数字时似乎自动出现在 y 轴上的 k。我尝试将数据上传到 plotly 在线,它把 ' 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/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 )

最佳答案

北轴布局就行tickformat = "digit"或 tickformat = "000"

关于r - 为 R : Remove the k that apears on the y axis when the dataset contains numbers larger than 1000 作图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39735303/

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