-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Now that the plot titles and captions can be aligned with respect to the full plot area, it would be great if the same was true for the legend. At the moment, if the legend is positioned at the top of the plot below the title it is aligned to the plot panel, making it misaligned with the title:
library(ggplot2)
ggplot(data = diamonds, mapping = aes(x = carat, y = price, color = cut)) +
geom_point() +
labs(title = "A plot title") +
theme(plot.title.position = "plot",
legend.position = "top",
legend.justification = "left")
Created on 2020-05-22 by the reprex package (v0.3.0)
Experimenting with negative values in legend.justification = c(x,y)
can get the legend to align with the title, but the value is dependent on the size of the y-axis labels
danwwilson, werkstattcodes, malcalakovalski, ofaakye and mfherman