gizmo_grob | R Documentation |
This guide displays a user-provided grob.
gizmo_grob(
grob,
width = grobWidth(grob),
height = grobHeight(grob),
hjust = 0.5,
vjust = 0.5,
position = waiver()
)
grob |
A |
width , height |
A [ |
hjust , vjust |
A |
position |
Where this guide should be drawn: one of |
A <GizmoGrob>
object.
Other gizmos:
gizmo_barcap()
,
gizmo_density()
,
gizmo_histogram()
,
gizmo_stepcap()
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")
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.