Box Plot
Summarizes the distribution of a dataset, showing quartiles, median, and outliers. This provides a concise and informative visual summary of the distribution of a dataset, highlighting key features such as the central tendency, spread, and presence of outliers. It is widely used in exploratory data analysis and statistical inference.
Chart:
Code:
muze
.canvas()
.columns(["Maker"])
.rows([muze.Operators.share("min", "max", "q1", "median", "q3")])
.data(rootData)
.layers([
{
mark: "bar",
encoding: {
y: "q3",
y0: "median",
color: "Maker",
},
},
{
mark: "bar",
encoding: {
y: "median",
y0: "q1",
color: "Maker",
},
},
{
mark: "tick",
encoding: {
y: "q1",
y0: "min",
color: {
value: () => "black",
},
},
},
{
mark: "tick",
encoding: {
y: "median",
color: {
value: () => "#fff",
},
},
},
{
mark: "tick",
encoding: {
y: "max",
y0: "q3",
color: {
value: () => "black",
},
},
},
])
.config({
axes: {
y: {
name: "Horsepower Distribution",
},
},
})