Skip to content
Lisa Zhang edited this page Nov 29, 2013 · 5 revisions

WikiAPI ReferenceChart SpecificationCoordinate

Charts are always plotted in a set coordinate system. Coordinate systems adjust the mapping from coordinates to the 2d plane of the computer screen. Usually charts are plotted in cartesian coordinates, but a polar coordinate is also available.

A coordinate system is represented in the graph specification as a JSON object coord with a number of attributes. These attributes are:

coord.type

Type String
Required No (Optional)
Default cartesian

Either cartesian or polar, describing the desired coordinate system to use. If a polar coordinate is chosen, then the x aesthetic will actually be mapped to the radius and the y aesthetic will be mapped to the angle.

coord.flip

Type Bool
Required No (Optional)
Default False

If set to true, the x- and y-aesthetic will be flipped.

Note that flipping the coordinate and swapping the x- and y-aesthetic mapping can produce different graphics, since some plots interepret the x- and y-mapping differently. For example, the box plot will use x as a grouping parameter and y to determine the height of the bar. As another example, the line plot expects the x values to be unique.