changing legend size and number of columns

50 views
Skip to first unread message

lily li

unread,
Nov 23, 2015, 12:40:33 AM11/23/15
to ggp...@googlegroups.com
Hi ggplot users,

I want to ask that how to change legend size in the figure? and how to change it from one column to several columns?

For example, when changing legend size, I use the code below but the legend size does not change with different numbers. Thanks for your help.
legend.title=element_text(size=12)

Dennis Murphy

unread,
Nov 23, 2015, 4:11:31 PM11/23/15
to lily li, ggp...@googlegroups.com
Hi:

Start here: http://docs.ggplot2.org/current/guide_legend.html

Some legend options are handled by the theming system, others by the
guide_legend() function. Go through the examples in guide_legend() to
get a feel for what it can do.

From what you described, changing the arrangement from one to multiple
columns is done with guide_legend(). For non-data features such as
sizing, the theming system is usually more appropriate, but check the
arguments to guide_legend() - some alternatives may be available
there.

In the absence of a reproducible example and (at least) a description
of the desired result, there isn't much else to offer in the way of
help.

Dennis
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ggplot2+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages