我正在尝试使用 R 和 plotly 构建 Weibull 概率图,但无法正确设置 y 轴值(即绘制的标记与下面示例中给出的位置不对应)。
library(plotly)
time <- c(30, 49, 82, 90, 96)
probability <- c(0.0976, 0.2533, 0.4102, 0.5673, 0.7243)
datum <- c(3.007, 3.777, 4.754, 5.941, 7.472, 9.300, 9.382, 11.811, 14.991, 18.854, 20.968,
23.728, 29.874, 29.924, 37.717, 47.534, 60.232, 76.910, 78.034, 94.931, 98.347,
124.650, 155.927, 195.327, 245.654)
unreliability <- c(0.0010, 0.0016, 0.0025, 0.0040, 0.0064, 0.0100, 0.0102, 0.0162, 0.0256,
0.0405, 0.0500, 0.0638, 0.0996, 0.1000, 0.1538, 0.2336, 0.3453, 0.4906,
0.5000, 0.6321, 0.6584, 0.8193, 0.9344, 0.9869, 0.9990)
log_prob <- log(1/(1-probability))
log_unrel <- log(1/(1-unreliability))
probPlot <- plot_ly(x=time, y=log_prob, type='scatter', mode='markers', showlegend=FALSE) %>%
layout(xaxis = list(type='log'), yaxis = list(type='log')) %>%
add_trace(x=datum, y=log_unrel, mode='lines',
marker=list(color='transparent'))
probPlot