I create a simple scatter plot with ggplot2 and visualise the z-variable with a color:
require(ggplot2)
data = data.frame(x=runif(1000), y=runif(1000), vis=rf(1000, df1=1, df2=3))
qplot(x=x, y=y, data=data, color=vis)
however, this is of course not very informative since the distribution is heavily skewed:
hist(data$vis)
the problem – in my opinion – is the equidistant breaks that creates bins for data that is simply not in the sample.
so here is my question: is there an efficient way of overcoming this problem and creating more breaks where more data is available. or in other words i’m looking for non-linear breaks or non-equidistant braks.
Edit: probably something more similar to what you want:
Old answer: In this case breaks are not what you really want
Considering amount of data we have
so possibly something like
would be good, here points > 5 are grey. A more complicated solution, which you maybe wanted in the first place would be this.