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(number, ExprRef)

The radius in pixels of rounded rectangles or arcs’ corners.

Default value: 0

orient

Orientation

The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.

  • For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.

  • For area, this property determines the orient property of the Vega output.

  • For line and trail marks, this property determines the sort order of the points in the line if config.sortLineBy is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored.

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,
)