Unexpected behaviour for custom histogram limits in Gadfly

If one plots the histogram of some data in Gadfly everything works fine.

d = randn(250);
plot(x=d, Geom.histogram(bincount=35))

However, providing the limits to plot the histogram of data between -5 and 0

plot(x=d, Geom.histogram(bincount=35, limits=(min=-5, max=0)))

one does not get what expected since the whole distribution is still there but just shifted to the left, as shown below.

I would have expected the histogram to be displayed between min and max divided in bincount bins. Instead, this behavior of the limits parameter, is quite misleading since it changes the data one is trying to plot.

PS Gadfly v1.3.0

1 Like

That’s definitely a bug. Will fix.

Perfect, thanks.