Learn R Programming

treemapify (version 2.3.1)

ggplotify: Draw an exploratory treemap

Description

Takes a data frame of treemap coordinates produced by "treemapify" and draws an exploratory treemap. The output is a ggplot2 plot, so it can be further manipulated e.g. a title added.

Usage

ggplotify(treeMap, label.colour = "white", label.type = "shrink",
  label.size = 24, label.min.size = 4, label.place = NULL,
  rect.border.colour = "grey", rect.border.size = 0.2,
  group.labels = TRUE, group.label.colour = "grey20",
  group.label.type = "shrink", group.label.size = 36,
  group.label.min.size = 4, group.label.place = NULL,
  group.border.colour = "grey50", group.border.size = 1.2)

Arguments

treeMap

A data frame of treemap coordinates produced by "treemapify"

label.colour

Colour for individual rect labels; defaults to white

label.type

How the labels should be drawn inside each rect. <U+2018>shrink<U+2019> (default) will cause the labels to be drawn at <U+2018>label.size<U+2019>, unless that would make them too big for the rects, in which case they are shrunk to fit the rects. <U+2018>fill<U+2019> draws the labels at the largest possible size for their rects. See documentation for the ggfittext package for more details.

label.size

Size for individual rect labels, in points. Defaults to 24 pt.

label.min.size

Any label shrunk below this size (in points) will not be drawn. Defaults to 4 pt.

label.place

Where in the rect should the label be drawn? Defaults to <U+2018>topleft<U+2019>, unless label.type is <U+2018>fill<U+2019> in which case defaults to <U+2018>middle<U+2019>. See ggfittext documentation for more details.

rect.border.colour

Colour for the borders between rects. Defaults to grey.

rect.border.size

Size (line thickness) for the borders between rects. Defaults to 0.2.

group.labels

Logical indicating whether groups should be labeled. Defaults to TRUE.

group.label.colour

Colour for group labels. Defaults to grey20.

group.label.type

How the group labels should be drawn inside each group. <U+2018>shrink<U+2019> (default) will cause the labels to be drawn at <U+2018>label.size<U+2019>, unless that would make them too big for the rects, in which case they are shrunk to fit the rects. <U+2018>fill<U+2019> draws the labels at the largest possible size for their rects. See documentation for the ggfittext package for more details.

group.label.size

Size for group labels, in points. Defaults to 36 pt.

group.label.min.size

Any group label shrunk below this size (in points) will not be drawn. Defaults to 4 pt.

group.label.place

Where in the group should the group label be drawn? Defaults to <U+2018>bottom<U+2019>, unless group.label.type is <U+2018>fill<U+2019> in which case defaults to <U+2018>middle<U+2019>. See ggfittext documentation for more details.

group.border.colour

Colour for borders around groups. Defaults to grey50.

group.border.size

Size (line thickness) for borders around groups. Defaults to 1.2.

See Also

Other treemapify: treemapify_fixed, treemapify