Closed MilesMcBain closed 2 years ago
New param for scales: col_label
. Takes either a function with column name as input; or a string with optional "{.col}" template placeholder (which is replaced by the column name).
Examples:
scale_color_power(foo_column, col_label = "sqrt({.col})")
scale_color_power(foo_column, col_label = "a new name")
scale_color_power(foo_column, col_label = snakecase::to_sentence_case)
scale_color_power(foo_column, col_label = function(col) paste0("sqrt(", col, ")"))
Visual:
Useful where you have a column that you know is already transformed and you want to include that in the legend generated for the scale.
The legend then says:
Demand Heatmap colored by sqrt(incidents)