Skip to content

Commit 8031a33

Browse files
committed
rescue old palettes
1 parent 78660a9 commit 8031a33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/scale-discrete-.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ ScaleDiscretePosition <- ggproto("ScaleDiscretePosition", ScaleDiscrete,
140140

141141
map = function(self, x, limits = self$get_limits()) {
142142
if (is.discrete(x)) {
143+
# Guard against old use of having identity palettes
144+
if (identical(.subset2(self, "palette"), identity)) {
145+
self$palette <- seq_len
146+
}
143147
values <- self$palette(length(limits))
144148
if (!is.numeric(values)) {
145149
cli::cli_abort(

0 commit comments

Comments
 (0)