[R] Custom manual legend in ggplot2

Giorgio Garziano giorgio.garziano at ericsson.com
Wed Dec 9 15:10:19 CET 2015


Try to look at the link:

http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/


Also consider:

help(theme)

legend.background    background of legend (element_rect; inherits from rect)
legend.margin   extra space added around legend (unit)
legend.key background underneath legend keys (element_rect; inherits from rect)
legend.key.size size of legend keys (unit; inherits from legend.key.size)
legend.key.height    key background height (unit; inherits from legend.key.size)
legend.key.width     key background width (unit; inherits from legend.key.size)
legend.text     legend item labels (element_text; inherits from text)
legend.text.align    alignment of legend labels (number from 0 (left) to 1 (right))
legend.title    title of legend (element_text; inherits from title)
legend.title.align   alignment of legend title (number from 0 (left) to 1 (right))
legend.position the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector)
legend.direction     layout of items in legends ("horizontal" or "vertical")
legend.justification anchor point for positioning legend inside plot ("center" or two-element numeric vector)
legend.box arrangement of multiple legends ("horizontal" or "vertical")
legend.box.just justification of each legend within the overall bounding box, when there are multiple legends ("top", "bottom", "left", or "right")

--

GG

	[[alternative HTML version deleted]]



More information about the R-help mailing list