正方形#
square 标记类似于 point 标记,不同之处在于 (1) shape 值始终设置为 square (2) 它们默认填充。
正方形标记属性#
一个 square 标记定义可以包含任何 标准标记属性 以及以下特殊属性
使用正方形的点状图#
import altair as alt
from vega_datasets import data
source = data.cars()
alt.Chart(source).mark_square().encode(
x="Horsepower:Q",
y="Miles_per_Gallon:Q",
)