Skip to content

position_arguments

position_arguments(
    row_height: float = 1.0,
    row_space: float = 0.1,
    row_bigspace: float = 1.2,
    col_width: float = 1.0,
    col_space: float = 0.1,
    col_bigspace: float = 0.5,
    col_annot_offset: float = 3.0,
    col_annot_angle: float = 30.0,
    expand_xmin: float = 0.0,
    expand_xmax: float = 2.0,
    expand_ymin: float = 0.0,
    expand_ymax: float = 0.0,
    col_annot_position: Literal["top", "bottom"] = "top",
    col_group_radius: float = 0.0,
    legend_position: Literal[
        "bottom", "right", "none"
    ] = "bottom",
) -> PositionArguments

Spacing and placement settings for funky_heatmap, in data units (0.25 inch).

The first twelve arguments are funkyheatmap's position_arguments(), with the same defaults. The last three are ggrust additions.

Parameters:

  • row_height (float, default: 1.0 ) –

    Height of a row.

  • row_space (float, default: 0.1 ) –

    Space between rows.

  • row_bigspace (float, default: 1.2 ) –

    Space between row groups.

  • col_width (float, default: 1.0 ) –

    Kept for funkyheatmap compatibility; column widths come from column_info.

  • col_space (float, default: 0.1 ) –

    Space between columns.

  • col_bigspace (float, default: 0.5 ) –

    Space between column groups.

  • col_annot_offset (float, default: 3.0 ) –

    Room reserved for the column names.

  • col_annot_angle (float, default: 30.0 ) –

    Angle of the column names, in degrees.

  • expand_xmin (float, default: 0.0 ) –

    Extra room around the table (defaults 0, 2, 0, 0), e.g. for long column names.

  • expand_xmax (float, default: 0.0 ) –

    Extra room around the table (defaults 0, 2, 0, 0), e.g. for long column names.

  • expand_ymin (float, default: 0.0 ) –

    Extra room around the table (defaults 0, 2, 0, 0), e.g. for long column names.

  • expand_ymax (float, default: 0.0 ) –

    Extra room around the table (defaults 0, 2, 0, 0), e.g. for long column names.

  • col_annot_position ((top, bottom), default: "top" ) –

    Where the column names go. "bottom" writes them below the table, ending at the table, and keeps the column groups on top.

  • col_group_radius (float, default: 0.0 ) –

    Corner radius of the column group headers; half the header height (0.5) draws pills.

  • legend_position ((bottom, right, none), default: "bottom" ) –

    Where the legends go: in a row below the table (funkyheatmap), in a column to its right, or nowhere.

Returns:

Raises:

  • SpecError –

    For a negative size, or an unknown col_annot_position / legend_position.

Examples:

>>> from ggrust.bistro import position_arguments
>>> position_arguments(col_annot_angle=90, legend_position="right").legend_position
'right'