Skip to main content

Histogram

Shows the frequency distribution of a variable by dividing it into bins. This provides a visual representation of the shape and spread of the data distribution. It is useful for understanding the underlying probability distribution of a variable, identifying potential outliers, and comparing the distributions of different variables.

Chart:


Code:

  muze
.canvas()
.columns(["Horsepower(BIN)"])
.rows(["Horsepower"])
.layers([
{
mark: "bar",
encoding: {
color: "Horsepower",
},
},
])
.config({
axes: {
x: {
compact: true,
labels: {
rotation: 0,
},
bins: {
display: "startValue",
position: "start",
},
},
},
})