circle <- grid::circleGrob()
# A standard plot with grob gizmos
ggplot(mpg, aes(displ, hwy, colour = cty)) +
geom_point() +
guides(
x.sec = gizmo_grob(
circle, hjust = 0.75,
width = unit(2, "cm"), height = unit(2, "cm")
),
colour = gizmo_grob(
circle, width = unit(1, "cm"), height = unit(1, "cm")
)
)
Run the code above in your browser using DataLab