Menu

Histogram

In this tutorial, we’ll demonstrate how to draw a Histogram in Glimpse to visualize the distribution in a dataset. Histograms help provide an estimate as to where values are concentrated, what the extremes are and whether there are any gaps or unusual values.

First, add in the data by going Data > Sample Data > movies.json from the top menu.

Then, under Visual > Mark in the Inspector panel, set the Mark Type to Bar.

image1


Click on the Y encoding well.

image2


Then in the Inspector panel press Field

image3


And under Aggregate, select Count.

image4


After, drag the quantitative field IMDB_Rating into the X encoding.

image5


Because the graph is overly ‘peaky’, we need to arrange the data values into ‘bins’. This can be done by enabling Bin in the Inspector panel (located under Visual > Encoding).

image6


Under the Bin menu, there are options to specify the bin settings. By default, Nice is ticked, which automatically attempts to make bin boundaries that are human-friendly, such as using multiples of 10.

image7


One way to change the number of bins is through the Max Bins field. If you enter 4 the number of bars will be reduced.

image8


Increasing the number will increase the number of bins and therefore the number of bars displayed.

image9


This concludes this tutorial on drawing a Histogram. If you want to further customize your chart, please read the documentation.