You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/syntax/coord/polar.qmd
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,8 @@ DRAW bar
63
63
PROJECT TO polar
64
64
SETTING start => -90, end => 90
65
65
```
66
-
This creates a gauge chart spanning from the 9 o'clock to 3 o'clock position (a 180° arc at the top).
66
+
67
+
This creates a gauge chart spanning from the 9 o'clock to 3 o'clock position (a 180° arc at the top). Note that scale expansion is applied by default so the data does not fill the whole half-circle.
Copy file name to clipboardExpand all lines: doc/syntax/layer/type/point.qmd
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,8 @@ DRAW point
57
57
FILTER sex = 'female'
58
58
```
59
59
60
+
When points are plotted on a discrete scale you will likely see a lot of overplotting. Use jitter position to introduce a bit of random offset to counter that.
61
+
60
62
```{ggsql}
61
63
VISUALISE species AS x, sex AS y, island AS fill FROM ggsql:penguins
Copy file name to clipboardExpand all lines: doc/syntax/scale/aesthetic/0_position.qmd
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
title: "Position"
3
3
---
4
4
5
-
Position aesthetics (`x` and `y`, plus all their variants) relate data to placement in the coordinate system of the plot. All layers need at least one of each positional aesthetic mapped in order to show its data. However, the layer may compute positional aesthetics from the mapping. For example, a bar plot calculates the `y` aesthetic by counting the number of records in each group.
5
+
Position aesthetics relate data to placement in the coordinate system of the plot. All layers need at least one of each positional aesthetic mapped in order to show its data. However, the layer may compute positional aesthetics from the mapping. For example, a bar plot calculates the `y` aesthetic by counting the number of records in each group defined by the mapped `x` aesthetic.
6
+
7
+
In the above we use `x`and `y` as examples of position aesthetics but in reality the position aesthetic names are defined by the coordinate system in use. A Cartesian coordinate system recognizes `x` and `y` whereas a polar coordinate system recognizes `radius` and `angle`. You can implicitly choose the coordinate system by mapping to the aesthetics that it uses, i.e. if you map to `radius` and `angle` then a polar coordinate system will be chosen for you.
6
8
7
9
## Literal values
8
10
Scales for position aesthetics never use an output range and always relate to the input range. This is a practical decision by ggsql because different writers may treat the positional aesthetic in different ways. ^[In reality one could easily think of positional literal values as either normalized position along the x or y axis, or absolute units of distance from the bottom left corner of the coordinate system.]
@@ -12,14 +14,10 @@ The lack of true literal values in position means that it is currently hard to p
12
14
:::
13
15
14
16
## Aesthetic families
15
-
Positional aesthetics consist of two families: The `x` and `y` family. Each of these consist of their primary aesthetic along with a range of sub aesthetic defined by their suffix:
17
+
Positional aesthetics have variants defined by a suffix attached to the primary name (e.g. `x`). The recognized suffixes are:
16
18
17
-
*`2`
18
19
*`end`
19
20
*`min`
20
21
*`max`
21
22
22
-
Which version of aesthetic to use depends on the layer, but all aesthetics within a family is scaled by the same scale, which is named after its primary aesthetic. This means that even when rendering a layer that only uses `xmin` and `xmax`, you will still scale it by writing `SCALE x ...` and label it by writing `LABEL x => ...`
23
-
24
-
## Coordinate system
25
-
Another thing that makes positional aesthetics different from other aesthetic is that they are dependent on a coordinate system which takes position scales and defines how values should be converted to a location on a plane. The default Cartesian coordinate system does what is generally expected: it places points along two perpendicular axes in a 2D plane. Other systems such as polar coordinates may dramatically change the look of a layer, transforming both the straightness of lines and positional relation of data.
23
+
Which version of an aesthetic to use depends on the layer, but all aesthetics within a family is scaled by the same scale, which is named after its primary aesthetic. This means that even when rendering a layer that only uses `xmin` and `xmax`, you will still scale it by writing `SCALE x ...` and label it by writing `LABEL x => ...`
Copy file name to clipboardExpand all lines: doc/syntax/scale/aesthetic/Z_faceting.qmd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Faceting
4
4
5
5
ggsql provides one or two aesthetics related to faceting. These are special in the sense that they do not alter the display of the single data values, but rather alter in which plot they appear. While it is possible to map to these aesthetics in a layer they are most often applied globally as part of the [`FACET` clause](../../clause/facet.qmd).
6
6
7
-
The aesthetics provided are either `panel` (for 1-dimensional faceting) or `row` and `column` (for 2-dimensional faceting). These aesthetics have to compatible with the facet clause: it is not possible to map to `panel` in a 2-dimensional faceting plot nor is it possible to map `row` and `column` in a 1-dimensional plot.
7
+
The aesthetics provided are either `panel` (for 1-dimensional faceting) or `row` and `column` (for 2-dimensional faceting). These aesthetics have to be compatible with the facet clause: it is not possible to map to `panel` in a 2-dimensional faceting plot nor is it possible to map `row` and `column` in a 1-dimensional plot.
8
8
9
9
## Literal values
10
10
Scales for facet aesthetics never use an output range and always relate to the input range. This means that no concept of literal values applies.
0 commit comments