lifecycle::badge("experimental")
Creates a list of settings for plotting the column/row sums
in plot_confusion_matrix()
.
The `tc_`
in the arguments refers to the total count tile.
NOTE: This is very experimental and will likely change.
sum_tile_settings(
palette = NULL,
label = NULL,
tile_fill = NULL,
font_counts_color = NULL,
font_normalized_color = NULL,
dynamic_font_colors = dynamic_font_color_settings(),
tile_border_color = NULL,
tile_border_size = NULL,
tile_border_linetype = NULL,
tc_tile_fill = NULL,
tc_font_color = NULL,
tc_tile_border_color = NULL,
tc_tile_border_size = NULL,
tc_tile_border_linetype = NULL,
intensity_by = NULL,
intensity_lims = NULL,
intensity_beyond_lims = NULL,
font_color = deprecated()
)
List of settings.
Color scheme to use for sum tiles.
Should be different from the `palette`
used for the regular tiles.
Passed directly to `palette`
in
ggplot2::scale_fill_distiller
.
Try these palettes: "Greens"
, "Oranges"
, "Greys"
,
"Purples"
, "Reds"
, and "Blues"
.
Alternatively, pass a named list with limits of a custom gradient as e.g.
`list("low"="#e9e1fc", "high"="#BE94E6")`
. These are passed to
ggplot2::scale_fill_gradient
.
Note: When `tile_fill`
is specified, the `palette`
is ignored.
The label to use for the sum column and the sum row.
Color of the text in the tiles with the column and row sums.
Either the value directly passed to ggplot2::geom_text
or
a function that take in the values (e.g., counts, percentages, etc.)
and returns a vector of values to pass to ggplot2::geom_text
.
A list of settings for using dynamic font colors
based on the value of the counts/normalized. Allows changing the font colors
when the background tiles are too dark, etc.
Can be provided with
dynamic_font_color_settings(threshold =, by =, all =, counts =, normalized =)
.
Individual thresholds can be set for the different fonts/values via the
`font_*_color`
arguments. Specifying colors in these arguments will overwrite
this argument (for the specific font only).
Specifying colors for specific fonts overrides the "all" values for those fonts.
Specific background color for the tiles. Passed as `fill`
to
ggplot2::geom_tile
.
If specified, the `palette`
is ignored.
Color of the text in the total count tile.
Color of the tile borders. Passed as `colour`
to
ggplot2::geom_tile
.
Size of the tile borders. Passed as `size`
to
ggplot2::geom_tile
.
Linetype for the tile borders. Passed as `linetype`
to
ggplot2::geom_tile
.
The measure that should control the color intensity of the tiles.
Either `counts`
, `normalized`
, `row_percentages`
, `col_percentages`
,
or one of `log counts`, `log2 counts`, `log10 counts`, `arcsinh counts`
.
For `normalized`, `row_percentages`, and `col_percentages`, the color limits
become 0-100
(except when `intensity_lims`
are specified),
why the intensities can better be compared across plots.
Note: When `add_sums=TRUE`
, the `row_percentages` and `col_percentages`
options are only available for the main tiles. A separate intensity metric
must be specified for the sum tiles (e.g., via
`sums_settings = sum_tile_settings(intensity_by='normalized')`
).
For the `log*` and `arcsinh` versions, the log/arcsinh transformed counts are used.
Note: In `log*` transformed counts, 0-counts are set to `0`, why they won't be distinguishable from 1-counts.
A specific range of values for the color intensity of
the tiles. Given as a numeric vector with c(min, max)
.
This allows having the same intensity scale across plots for better comparison of prediction sets.
What to do with values beyond the
`intensity_lims`
. One of "truncate", "grey"
.
Deprecated.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Other plotting functions:
dynamic_font_color_settings()
,
font()
,
plot_confusion_matrix()
,
plot_metric_density()
,
plot_probabilities()
,
plot_probabilities_ecdf()