plot two dgr_graphs side by side in r

You can achieve this by using the par() function in R to split the plotting region into multiple panels. Here's an example code to plot two igraph graphs side by side:

# Assuming g1 and g2 are your two graph objects
library(igraph)

# Create layout for first graph
layout1 <- layout_nicely(g1)

# Create layout for second graph
layout2 <- layout_nicely(g2)

# Set up the plotting region
par(mfrow=c(1,2))

# Plot the first graph
plot(g1, layout=layout1)

# Plot the second graph
plot(g2, layout=layout2)
336 chars
18 lines

This code will plot g1 and g2 side by side in a single plotting region.

related categories

gistlibby LogSnag