Home > Net >  Is there a way to specify the line width with the function linesGrob() in R?
Is there a way to specify the line width with the function linesGrob() in R?

Time:03-21

I would like to adjust the line width (thinner than default value) within the function linesGrob() in R. Width argument does not seem to work. Is there another way?

CodePudding user response:

You could set the line width via the gp (graphical parameters) argument. The graphical parameter settings itself could be set via grid::gear where the line width is set via argument lwd:

library(grid)

grid.newpage()
p <- linesGrob(gp = gpar(lwd = unit(10, "pt")))
grid.draw(p)

  • Related