Press "Enter" to skip to content

Positioning the Legend in a ggplot2 Plot

Zhenguo Zhang moves the legend somewhere else:

By default, ggplot2 places the legend outside the plot area (usually on the right). However, sometimes you may want to move the legend inside the plot to save space or improve the layout. This post explores how to achieve this using theme() parameters.

Click through to see what options are available.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.