{grid}
gp <- gpar(
fill = 'red',
col = 'green',
lwd = 12
)
cg <- circleGrob(
x = unit(0.4, 'npc'),
y = unit(0.3, 'npc'),
r = unit(5, 'mm'),
gp = gp
)
cg
#> circle[GRID.circle.1]
grid.newpage()
grid.draw(cg)
{ingrid}
grob creation in ingrid offers:
.npc()
is equivalent to
unit(x, 'npc')
gpar()
call
cg <- ingrid::ig_circle(
x = .npc(0.4),
y = .npc(0.3),
r = .mm(5),
fill = 'red',
col = 'blue',
lwd = 12
)
ingrid::register_verbose_printing()
cg
#> circle [GRID.circle.2]
#> x=c(0.4npc), y=c(0.3npc), r=c(5mm)
#> gp:
#> col: blue
#> fill: red
#> lwd: 12
#> vp: [GRID.VP.1] default
grid.newpage()
grid.draw(cg)
ig_rect()
, ig_polygon()
,
ig_lines()
etc