Learn R Programming

treemapify (version 2.3.1)

geom_treemap_subgroup_text: Text labels for treemap subgroups.

Description

Requires <U+2018>area<U+2019> and <U+2018>subgroup<U+2019> aesthetics. Strange things will happen if geom_treemap_subgroup_text is given a different dataset or area aesthetic than the geom_treemap it is drawn over.

geom_treemap_subgroup_text uses geom_fit_text from the ggfittext package to fit text to the subgroup. All text drawing options available in ggfittext (growing, reflowing, etc.) are also available here. For full details see the documentation for ggfittext::geom_fit_text.

Usage

geom_treemap_subgroup_text(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = FALSE,
  inherit.aes = TRUE, fixed = F, ...)

Arguments

mapping, data, stat, position, na.rm, show.legend, inherit.aes, ...

Standard geom arguments as for geom_rect.

fixed

Logical, indicating whether the fixed layout algorithm should be used. Defaults to false. See geom_treemap for full details.

padding.x, padding, y

Unit object, giving horizontal or vertical padding between text and edge of tile. Defaults to 1 mm.

place

Where should the text be drawn within the subgroup? One of <U+2018>topleft<U+2019>, <U+2018>top<U+2019>, <U+2018>topright<U+2019> etc. Defaults to <U+2018>bottom<U+2019>.

min.size

Number, in points. Text that would need to be drawn smaller than this size to fit in the subgroup will be hidden. Defaults to 4 pt.

grow

Logical; should text be grown to fill the entire subgroup? Defaults to false.

reflow

Logical; should text should be reflowed (wrapped) to better fit the bounding box? Defaults to false.

Aesthetics

  • area (required)

  • label (required)

  • colour

  • size

  • alpha

  • family

  • fontface

  • angle

See Also

geom_treemap, geom_treemap_subgroup_border