Create dot plots with thin horizontal bars in GT cells.
The gt_plt_dot() function takes an existing GT object and adds dot plots with horizontal bar charts to a specified category column. Each cell displays a colored dot according to the value in the assigned category column and a horizontal bar representing the corresponding numeric value from the data column.
Parameters
gt:GT
A GT object to modify.
category_col:SelectExpr
The column containing category labels that will be displayed next to colored dots. The coloring of the dots are determined by this column.
data_col:SelectExpr
The column containing numeric values that will determine the length of the horizontal bars.
width:int=120
The width of the SVG plot in pixels. You may need to increase this if your category labels are long.
height:int=30
The height of the SVG plot in pixels.
font_size:int=16
The font size for the category label text.
domain:list[int] | list[float] | None=None
The domain of values to use for the color scheme. This can be a list of floats or integers. If None, the domain is automatically set to [0, max(data_col)].
palette:list[str] | str | None=None
The color palette to use. This should be a list of colors (e.g., ["#FF0000"◉, "#00FF00"◉, "#0000FF"◉]). A ColorBrewer palette could also be used, just supply the name (see GT.data_color() for additional reference). If None, then a default palette will be used.
Returns
:GT
A GT object with dot plots and horizontal bars added to the specified category column.