Ask Your Question
4

How can I modify the color and width of the borders of the vertices in an R graph plot?

asked 2023-04-28 20:46:27 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-04-28 21:15:02 +0000

plato gravatar image

You can modify the color and width of the borders of the vertices using the vertex.border and vertex.border.width arguments in the plot() or igraph.plot() function.

Here's an example code to modify the color and width of the vertex borders in an R graph plot:

library(igraph)

# create a sample graph with 5 vertices
g <- make_empty_graph(5) + 
  add_edges(c(1,2, 2,3, 3,4, 4,5, 5,1))

# plot the graph and modify vertex border color and width
plot(g, vertex.border = "blue", vertex.border.width = 2)

In this code, the vertex.border argument sets the color of the vertex borders to blue, and the vertex.border.width argument sets the width of the borders to 2. You can modify these values to set the desired color and width.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-28 20:46:27 +0000

Seen: 11 times

Last updated: Apr 28 '23