I want to recreate this plot using ggplot2:
However, I'm struggling to recreate the evenly spaced axis ticks. Here's a simplified code example of what I've got so far:
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))
Created on 2021-08-26 by the reprex package (v2.0.0)
Thank you very much!