Tick#
The tick
mark represents each data point as a short line. This is a useful mark for displaying the distribution of values in a field.
Tick Mark Properties#
A tick
mark definition can contain any standard mark properties
and the following special properties:
Click to show table
Property |
Type |
Description |
---|---|---|
cornerRadius |
anyOf( |
The radius in pixels of rounded rectangles or arcs’ corners. Default value: |
orient |
The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.
|
Examples#
Dot Plot#
The following dot plot uses tick marks to show the distribution of precipitation in Seattle.
import altair as alt
from vega_datasets import data
source = data.seattle_weather()
alt.Chart(source).mark_tick().encode(
x="precipitation:Q"
)
Strip Plot#
By adding a y
field, a strip plot can be created that shows the distribution of horsepower by number of cylinders.
import altair as alt
from vega_datasets import data
source = data.cars()
alt.Chart(source).mark_tick().encode(
x="Horsepower:Q",
y="Cylinders:O",
)
Customizing Tick’s Size and Thickness#
import altair as alt
from vega_datasets import data
source = data.seattle_weather()
alt.Chart(source).mark_tick().encode(
x="precipitation:Q"
).configure_tick(
thickness=2,
bandSize=10,
)