specifying number of breaks with scales in ggplot2 without a transform?
ggplot2, r
Solution
you can give `scale_x_continuous` a vector of breaks like this :
n=5
breaks = seq(min(dat$x),max(dat$x), length.out = n)
m + scale_x_continuous(breaks=breaks)
Problem
If I want my data axis to have more breaks but without a transformation on the values, how can I do it in ggplot2? eg: ``` ... + scale_x_continuous(breaks=scales.trans_breaks("log2", function(x) 2^x, n=8), limits=limits) ``` works if you want your data transformed and the `n=` parameter lets you say how many breaks. How can you specify breaks without transforming the data? Do you just give it an identity function?