【发布时间】:2021-08-26 10:07:51
【问题描述】:
我想用 ggplot2 重新创建这个情节:
但是,我正在努力重新创建均匀间隔的轴刻度。这是到目前为止我所拥有的简化代码示例:
library(ggplot2)
library(scales)
sim_df <- data.frame(fpr = seq(0.001, 0.999, 0.001),
fnr = rev(seq(0.001, 0.999, 0.001)))
ggplot(sim_df, aes(x = fpr, y = fnr)) +
geom_line() +
scale_y_continuous(labels = percent_format(1),
breaks = c(0.01, 0.05, 0.2, 0.5, 0.8, 0.95, 0.99)) +
scale_x_continuous(labels = percent_format(1),
breaks = c(0.01, 0.05, 0.2, 0.5, 0.8, 0.95, 0.99)) +
coord_cartesian(xlim = c(0.01, 1), ylim = c(0.01, 1))
由reprex package (v2.0.0) 于 2021 年 8 月 26 日创建
非常感谢!
【问题讨论】:
-
我不确定您的示例的规模是什么,但它不是线性的。我能找到的最接近的是
trans = "asn"转换,但它看起来与示例不太一样。