0

I would like to display a few CDF data (the R code is below), by using a set of numerical BREAKS on a X axis to be shown at EQUAL DISTANCE from each other (although numerically, the BREAKS are on log10 axis and do not reflecting an equal distance):

df <- data.frame(
  x = c(rnorm(100, 0, 3), rnorm(100, 0, 10)),
  g = gl(2, 100)
)

breaks=c(0.001, 0.01, 0.1, 1, 5, 10, 20, 30, 100)

ggplot(df, aes(x, colour = g)) + 
stat_ecdf()  + 
scale_x_log10(breaks=breaks), 

How shall I do it?

Julius Vainora
  • 47,421
  • 9
  • 90
  • 102
Bogdan
  • 345
  • 1
  • 16

1 Answers1

0

At the end, i've used the following R code :

ggplot(df, aes(x, colour = g)) + stat_ecdf() +   
scale_x_log10(breaks=breaks, limits=c(0.001, 1000)) +  
theme(axis.text.x = element_text(size=8, angle=45)) + 
labs(title="", y ="", x="PR") +
theme_classic()
Bogdan
  • 345
  • 1
  • 16