This website is for Vega-Lite v3. Go to the main Vega-Lite homepage for the latest release.

Point

Edit this page
{
  "data": ... ,
  "mark": "point",
  "encoding": ... ,
  ...
}

point mark represents each data point with a symbol. Point marks are commonly used in visualizations like scatterplots.

Documentation Overview

Point Mark Properties

// Single View Specification
{
  ...
  "mark": {
    "type": "point",
    ...
  },
  "encoding": ... ,
  ...
}

A point mark definition can contain any standard mark properties and the following special properties:

Property Type Description
shape String

Shape of the point marks. Supported values include:

  • plotting shapes: "circle", "square", "cross", "diamond", "triangle-up", "triangle-down", "triangle-right", or "triangle-left".
  • the line symbol "stroke"
  • centered directional shapes "arrow", "wedge", or "triangle"
  • a custom SVG path string (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)

Default value: "circle"

size Number

Default size for marks.

  • For point/circle/square, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.
  • For bar, this represents the band size of the bar, in pixels.
  • For text, this represents the font size, in pixels.

Default value: 30 for point, circle, square marks; rangeStep - 1 for bar marks with discrete dimensions; 5 for bar marks with continuous dimensions; 11 for text marks.

Examples

Dot Plot

Mapping a field to either only x or only y of point marks creates a dot plot.

Scatter Plot

Mapping fields to both the x and y channels creates a scatter plot.

By default, point marks only have borders and are transparent inside. You can create a filled point by setting filled to true.

Bubble Plot

By mapping a third field to the size channel in the scatter plot, we can create a bubble plot instead.

Scatter Plot with Color and/or Shape

Fields can also be encoded in the scatter plot using the color or shape channels. For example, this specification encodes the field Origin with both color and shape.

Geo Point

By mapping geographic coordinate data to longitude and latitude channels of a corresponding projection, we can visualize geographic points. The example below shows major airports in the US.

Point Config

// Top-level View Specification
{
  ...
  "config": {
    "point": ...,
    ...
  }
}

The point property of the top-level config object sets the default properties for all point marks. If mark property encoding channels are specified for marks, these config values will be overridden.

The point config can contain any point mark properties (except type, style, and clip).