Moving the legend
Let's wrap up this course by making a publication-ready plot communicating a clear message.
To change stylistic elements of a plot, call theme() and set plot properties to a new value. For example, the following changes the legend position.
p + theme(legend.position = new_value)
Here, the new value can be
"top","bottom","left", or"right'": place it at that side of the plot."none": don't draw it.c(x, y):c(0, 0)means the bottom-left andc(1, 1)means the top-right.
Let's revisit the recession period line plot (assigned to plt_prop_unemployed_over_time).
Questo esercizio fa parte del corso
Introduction to Data Visualization with ggplot2
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# View the default plot
plt_prop_unemployed_over_time
# Remove legend entirely
plt_prop_unemployed_over_time +
___