# Why do histograms not have spaces in between bars (as opposed to a bar graph)?

Lets say one wants a histogram . Say how many trades for a stock occurred on that day. And they are dead set on a histogram/bar graph. (as opposed to other representations

why are histograms typically like this , and should this always be the case ?

**In specific if you are determining how many trades happened each day or each month for a stock which one is better. I think there should be space but i still have some doubt because its not really a bin. **

here is an article i found but i feel like there must be some sigchi or better articles out there

-
can someone add histogram to this as a tag please im not at 300 rep yet – Frank Visaggio Apr 22 '14 at 18:27
In reading the linked article, my takeaway is that the key difference is that a histogram is the individual sums that make up one complete whole. Not having a gap helps (IMHO) make that clearer and differentiates it from a bar chart (which usually isn't showing parts of a whole, but comparing separate wholes). In the end, though, it's perhaps a matter of semantics to decide how to best present particular data. – DA01 Apr 22 '14 at 18:33

From Wikipedia:

In statistics, a histogram is a graphical representation of the distribution of data. It is an estimate of the probability distribution of a continuous variable.

The emphasis is on continuous variable, as opposed to discrete variable.

# The histogram

In the top histogram you've presented, the X axis is time, which is continuous in this context (it is divided to 10 minute bins, but the original data could have been in resolution of seconds, milliseconds, nanoseconds and so forth).

The way such histogram is derived is they probably had many samples, say 50,000 visits. It makes no sense to present a bar per visit time - the data will be useless; like if 900 users spent 1:42, nobody spent 1:41, and 800 spent 1:40 on the site. The average is much more important. So in this case, the samples were ordered and averaged into bins. In the graph you've provided, each bin represents 10 minutes.

Since the X axis is time, had they left any gap, it could mean that nobody spent time between 10 and 11 minutes. But this is not correct.

You could, in theory, replace this histogram with a bar graph, where the first bar would have an X value of 0-10 minutes, the second 10-20 minutes, and so forth. But the problem would be that you'd have 10 minutes sealing one bar and opening another (which makes no sense). So you'd have to change it to 00:00-10:00 minutes for the first bar, 10:01-20:00 minutes for the second bar, and so on. Which would be valid if your samples are down to a second resolution (if not, you may have to use 10:01:01 or all sorts of long time formats). It is much easier to show this on a histogram.

# The bar-chart

In the bottom graph, the X axis is months - clearly a discrete variable.

To generate this bar graph, they simply count visits to the US each month - there is no problem putting spaces on the X axis as it isn't continuous. The visual representation is valid.

-
+1 Subtle continuity of bins! – edgarator Apr 22 '14 at 22:41