# Add options to a graph after construction

Given a graph which has already been constructed, how can I add, e.g., the option VertexSize -> 3 to that graph without having to deconstruct the graph?

• Perhaps Show["graph",VertexSize->3]? Apr 16 '21 at 12:10

To add newoptions to a graph object g, you can use

Examples:

options = {VertexSize -> Large, PlotTheme -> "IndexLabeled", VertexStyle -> {1 -> Red}};

SeedRandom[1];

Grid[Partition[#,2], Dividers -> All]&[Labeled[#, HoldForm @ #, Top] & /@
{Unevaluated[rg = RandomGraph[{5, 9}, ImageSize -> 300]],
Unevaluated @ Graph[rg, options],
Unevaluated @ Annotate[rg, options],
Unevaluated @ SetProperty[rg,  options]}]


There's quite a nice copy function that lets you keep it as a graph expression

Probably more efficient ways if you have assigned the graph or use the % output

However as mentioned in the comments you should be able to manipulate by pasting the graph expression in place of "graph"

Show["graph",VertexSize->3]


@Ulrich Neumann