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/scale/aesthetic/1_color.qmd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Note that all different types of color notation can be mixed in the same place.
60
60
Literal color values may be translucent, either by providing a fourth channel the the hex-notation, or by using a css color function that includes an alpha level (e.g. `rgba()`). You should avoid mixing this with the use of the opacity aesthetic to ensure the opacity is predictable.
61
61
62
62
## Palettes
63
-
There are two different types of palettes for fill and stroke — those intended for continuous data and those intended for discrete data. While they both consists of multiple color values, the continuous palettes are meant for interpolation between successive values whereas the discrete palettes are not.
63
+
There are two different types of palettes for fill and stroke — those intended for continuous data and those intended for discrete data. While they both consist of multiple color values, the continuous palettes are meant for interpolation between successive values whereas the discrete palettes are not.
64
64
65
65
Palettes are used by giving them as names in the `TO` clause:
Copy file name to clipboardExpand all lines: doc/syntax/scale/type/continuous.qmd
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ The continuous scale type maps various continuous data types into a continuous o
9
9
## Input range
10
10
The input range for continuous scales are defined by their minimum and maximum values. These can be given explicitly or deduced from the mapped data. If `FROM` is omitted then the range of the mapped data is used. If provided as an array of length 2 then the first element will set the minimum and the second element will set the maximum. If either of these elements are `null` then that part of the range will be deduced from the data. As an example `SCALE x FROM (0, null)` will set the minimum part of the range to 0 and the maximum part to the maximal value of the mapped data.
11
11
12
-
Position aesthetics (`x` and `y`) will have their range expanded based on the `expand` setting.
12
+
Position aesthetics (`x` and `y`) will have their range expanded based on the `expand` setting.
13
13
If values in the mapped data falls outside of the input domain the values will be changed based on the `oob` setting.
14
14
15
15
The input range is converted to the type defined by the transformation. This means that a time range can both be given as a `%H:%M:%S` string or as a numeric giving the number of nanoseconds since midnight.
@@ -38,11 +38,11 @@ The output range can either be given as an array of values or a named palette. F
38
38
All aesthetics have a default output range so it is never required to provide one unless you want to change from the default. The defaults are as follows:
39
39
40
40
*`x`/`y`: Ignored (values used directly)
41
-
*`stroke`/`fill`: The `navia` palette
41
+
*`stroke`/`fill`: The `sequential` palette
42
42
*`size`/`linewidth`: `(1, 6)` (points)
43
43
*`opacity`: `(0.1, 1.0)` (0 being fully transparent and 1 being fully opaque)
44
44
45
-
The remaining aesthetics doesn't have a meaningful continuous output domain and doesn't work with continuous scales. Consider using a [binned scale](binned.qmd) for these if necessary.
45
+
The remaining aesthetics don't have a meaningful continuous output domain and don't work with continuous scales. Consider using a [binned scale](binned.qmd) for these if necessary.
46
46
47
47
### Examples
48
48
@@ -63,7 +63,7 @@ SCALE color TO ('black', 'red', 'white')
63
63
```
64
64
65
65
## Transformation
66
-
The transformation of the scale both defines how the input data is parsed as well as any mathematical transformation applied before it is mapped to the output range. The default transformation is deduced from a combination of the mapped data and the aesthetic the scale is applied to.
66
+
The transformation of the scale both defines how the input data is parsed as well as any mathematical transformation applied before it is mapped to the output range. The default transformation is deduced from a combination of the mapped data and the aesthetic the scale is applied to.
67
67
68
68
*`linear`: The default transformation unless stated otherwise. Creates a linear mapping between the input and output range.
69
69
*`log`/`log2`/`ln`: Creates a mapping between the logarithm of the input to the output range.
@@ -82,15 +82,15 @@ If not provided explicitly by the user the breaks for the scales will be calcula
82
82
83
83
*`linear`:
84
84
-`pretty => true`: Will use Wilkinsons Extended algorithm to attempt to find nice breaks in the given interval close to the number of breaks requested
85
-
-`pretty => false`: Will produce the requested number of evenly spaced breaks within the scale range
86
-
*`log`/`log2`/`ln`:
85
+
-`pretty => false`: Will produce the requested number of evenly spaced breaks within the scale range
86
+
*`log`/`log2`/`ln`:
87
87
-`pretty => true`: Will use the 1-2-5 pattern and thin down to approximately the requested number of breaks
88
88
-`pretty => false`: Breaks will be exclusively at the power of the base (e.g. 1, 10, 100, 1000 for log10)
89
89
*`exp10`/`exp2`/`exp`: Same logic as the log breaks but in the inverse direction
90
90
*`sqrt`/`square`: Like `linear` but the range is first converted to sqrt space and the breaks are then converted back
91
91
*`asinh`/`pseudo_log`/`pseudo_log2`/`pseudo_ln`: Like `log` but includes zero and negates the breaks for the negative part
92
92
*`integer`: Like `linear` except disallowing breaks at fractional parts
93
-
*`date`/`datetime`/`time`:
93
+
*`date`/`datetime`/`time`:
94
94
-`breaks => <interval>`: If breaks are given as an interval (e.g. `week`, `30 seconds` or `5 years`) then the breaks will get that spacing aligned at the interval boundary (Jan 1 for years, etc). This ignores the `pretty` setting
95
95
-`pretty => true`: An appropriate interval is chosen that approximates the requested number of breaks and then used as above
96
96
-`pretty => false`: Linear spacing in integer space as close to the requested number of breaks
@@ -154,7 +154,7 @@ The following settings are recognised by continuous scales:
154
154
```{ggsql}
155
155
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
156
156
DRAW point
157
-
SCALE x
157
+
SCALE x
158
158
SETTING expand => (0.0, 10)
159
159
```
160
160
@@ -172,7 +172,7 @@ SCALE y FROM (15, 20)
172
172
```{ggsql}
173
173
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
174
174
DRAW point
175
-
SCALE x
175
+
SCALE x
176
176
SETTING breaks => (37, 42, 55)
177
177
```
178
178
@@ -181,7 +181,7 @@ SCALE x
181
181
```{ggsql}
182
182
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
183
183
DRAW point
184
-
SCALE x
184
+
SCALE x
185
185
SETTING reverse => true
186
186
```
187
187
@@ -203,7 +203,7 @@ You can combine formatting with direct renaming in which case the direct renamin
203
203
```{ggsql}
204
204
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
205
205
DRAW point
206
-
SCALE x
206
+
SCALE x
207
207
RENAMING 50 => 'Fifty'
208
208
```
209
209
@@ -212,7 +212,7 @@ SCALE x
212
212
```{ggsql}
213
213
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
0 commit comments