The allowed values for the argumentslegend.positionare : “left”,“top”, “right”, “bottom”. Note that, the argumentlegend.positioncan be also a numeric vector c(x,y). In this case it is possible to position the legend inside the plotting area. x and y ...
<pre> theme( ##no legend.title legend.title = element_blank(), ## legend border legend.box.background = element_rect( size = 1), ##legend inside, change relative positions by 0.95, 0.95 legend.position = c(.95, .95), legend.justification = c("right", "top"), legend.box.just =...
To put it around the chart, use thelegend.positionoption and specifytop,right,bottom, orleft. To put it inside the plot area, specify a vector of length 2, both values going between 0 and 1 and giving the x and y coordinates.
* this is not part of ggplot specs * Legend Options for each legend */ fun padding(): Double // Space around legend content (px) fun margins(): Thickness // Space between legends fun spacing(): DoubleVector fun position(): LegendPosition 25 changes: 20 additions & 5 deletions 25 .....
x sets the x position with respect to xref from "0" (left) to "1" (right), and y sets the y position with respect to yref from "0" (bottom) to "1" (top). Moreover, you can define xanchor to left,right, or center for setting the title's horizontal alignment with respect ...