Skip to contents

Color And Legend

One-step helpers that color gt tables and attach matched legends.

gtscale_data_color_continuous()
Color a numeric gt column and add a matching continuous legend
gtscale_data_color_diverging()
Color a numeric gt column with a diverging scale and add a matching legend
gtscale_data_color_bins()
Color a numeric gt column and add a matching binned legend
gtscale_data_color_quantiles()
Color a numeric gt column and add a matching quantile legend
gtscale_data_color_discrete()
Color a categorical gt column and add a matching discrete legend

Legend Only

Lower-level helpers for attaching legends to tables that are already colored.

gtscale_color_continuous()
Add only a continuous color legend to a gt table
gtscale_color_diverging()
Add only a diverging color legend to a gt table
gtscale_color_bins()
Add only a binned color legend to a gt table
gtscale_color_quantiles()
Add only a quantile color legend to a gt table
gtscale_color_discrete()
Add only a discrete color legend to a gt table

Scale Specifications

Reusable scale definitions and application helpers.

gtscale_spec_continuous()
Create a continuous gtscales spec
gtscale_spec_diverging()
Create a diverging gtscales spec
gtscale_spec_bins()
Create a binned gtscales spec
gtscale_spec_quantiles()
Create a quantile gtscales spec
gtscale_spec_discrete()
Create a discrete gtscales spec
gtscale_spec_set_application()
Set how a gtscales spec is applied
gtscale_spec_set_legend()
Set how a gtscales legend should be rendered
gtscale_apply()
Apply only the color component of a gtscales spec
gtscale_legend()
Attach only the legend component of a gtscales spec
gtscale_apply_legend()
Apply a gtscales spec and attach its legend

Rendering

Render legends directly for supported outputs.

gtscale_render_legend()
Render a legend from a gtscale_spec