I have a question about the binwidth in ggplot in r.
I have two sets of data, one called "error_hat" and one called "error_tilde". I have made their histogram separately, and I see they are similar to each other.


Now I want to put them together to make a comparison. My code is as followed:
catagory <- c(rep("error_hat",length(error_hat)) , rep("error_tilde",length(error_tilde)))
error <- c(error_hat, error_tilde)
error_data<-data.frame(catagory,error)
ggplot(error_data, aes(x=error,group=catagory,fill=catagory))+
geom_histogram(position="dodge2", binwidth=0.03)+theme_bw()
It produces a picture like this:

I am wondering why the data in the middle has a different width (since I have set all the width to be 0.03)?
Could anyone help me with this problem? Many thanks!

binwidthdoesn't refer to the width of the bars as they appear on the chart, it refers to how your data is "binned" into groups to make a histogram. Sobinwidth = 0.03means that, for example, values from 0 - 0.03 will be counted up to make one bar, and values from 0.03-0.06 will be counted up to make the 2nd bar, and so on.