It does. the range of carat is
> range(diamonds$carat)
[1] 0.20 5.01
If the scale limits do not include those, then the error
Error in seq.default(origin[1], max(range$x) + binwidth[1], binwidth[1]) :
invalid (to - from)/by in seq(.)
is printed, but a plot is made (because this error happens inside a try
block) but without any bins (x scale seems reasonable, y doesn't, and
there are no 2d bins).
I think I found where the problem is. stat-bin2d.r:63, min(x) should be
min(x, na.rm=TRUE). I'll work on putting together a pull request if it
is really the problem.
> On Mar 16, 4:20 am, igreg<zooro...-hi6Y0CQ0nG0@public.gmane.org> wrote:
>> (d<- ggplot(diamonds, aes(carat, price)) +
>> stat_bin2d( colour="grey70") +
>> opts(legend.position = "none"))
>> d + scale_x_continuous(limits = c(0, 6))
>>
>> ... this one works. maybe it's because the max values are outside your
>> limits c(0,2)
>>
>> best, greg
>
--
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University
Created a pull request https://github.com/hadley/ggplot2/pull/448
>> On Mar 16, 4:20 am,
>> igreg<zooro...-hi6Y0CQ0nG0-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>