VISUALISE FROM ggsql:airquality
DRAW line
MAPPING Date AS x, Temp AS y
Line
Layers are declared with the
DRAWclause. Read the documentation for this clause for a thorough description of how to use it.
The line layer is used to create lineplots. Lineplots always connects records along the x-axis, in contrast to path layers which use the order of data to connect records. Lines are divided due to their grouping, which is the combination of the discrete mapped aesthetics and the columns specified in the layers PARTITION BY.
Aesthetics
The following aesthetics are recognised by the line layer.
Required
x: Position along the x-axisy: Position along the y-axis
Optional
colour/stroke: The colour of the lineopacity: The opacity of the linelinewidth: The width of the linelinetype: The type of line, i.e. the dashing pattern
Settings
The line layer has no additional settings
Data transformation
The line layer does not transform its data but passes it through unchanged
Examples
Standard lineplot
Use PARTITION BY to create multiple lines
VISUALISE FROM ggsql:airquality
DRAW line
MAPPING Day AS x, Temp AS y
PARTITION BY Month
or split them with an aesthetic
VISUALISE FROM ggsql:airquality
DRAW line
MAPPING Day AS x, Temp AS y, Month AS color