Scatter Plot with Shapes
Shows the relationship between two variables, with different shapes representing distinct categories. This allows for the visualization of not only the relationship between the two variables but also how the relationship differs across different categories. For example, it can be used to analyze the relationship between age and income, with different shapes representing different occupations.
Chart:
Code:
muze
.canvas()
.rows(["Miles_per_Gallon"])
.columns(["Weight_in_lbs"])
.detail(["Maker"])
.layers([
{
mark: "point",
encoding: {
shape: "Origin",
color: "Origin",
opacity: {
value: () => 1,
},
},
},
])
.config({
legend: {
shape: {
show: false,
},
},
})