Previously in ggplot2, I used a formatter function to multiply values in the Y axis by 100:
formatter100 <- function(x){
x*100 }
With t
Transformations actually transform the scale itself. In the case of your y
axis, you're just formatting the breaks. So you don't really want to use trans_new
, just a regular format function. Similarly, you want to use comma_format
rather than comma
, as the former actually returns a function as needed:
mult_format <- function() {
function(x) format(100*x,digits = 2)
}
p <- ggplot( test, aes(lat, ecdf) )
p<-p +
geom_point()+
scale_x_log10(breaks = xbreaks,labels = comma_format()) +
scale_y_continuous(trans='probit',
labels = mult_format(),
breaks=ybreaks) +
xlab("latency ms")
p