Reputation: 4294
How can I modify the legend of a plot built using ggplot2 with rpy2? My plot is the following:
plot_2 = (ggplot2.ggplot(second_dt) +
ggplot2.aes_string(x='timestamp', y='diff_percentage') +
ggplot2.geom_point() +
ggplot2.geom_line())
and I would like to modify the position of the legend.
Upvotes: 0
Views: 140
Reputation: 4294
Ok it was sufficient to do as follows:
plot_2 = (ggplot2.ggplot(second_dt) +
ggplot2.aes_string(x='timestamp', y='diff_percentage') +
ggplot2.geom_point() +
ggplot2.geom_line() +
ggplot2.theme(**{'legend.position': <position>}))
Upvotes: 0