cxstam
cxstam

Reputation: 333

plot igraph in a big area

Just wondering if it is possible to increase the size of the plot so that the nodes and edges can be more scattered over the plot.

Original plot:

enter image description here

What are expected:

enter image description here

I tried many parameters in the layout function such as area, niter, and so on, but all of them do not work. By the way, I am using 'igraph' package in R.

Upvotes: 4

Views: 5495

Answers (2)

DylanSu
DylanSu

Reputation: 51

In your second graph, it's obviously the graph can be divided into several clusters (or sections). If I understood you correctly, you want to have a layout that separates your clusters more visibly.

Then you can draw this by calculating a two-level layout: First, calculate the layout of the graph in order to find a place for each cluster. Second, calculate the layout in each cluster according to first step and plot nodes in the corresponding place.

Upvotes: 2

cbento
cbento

Reputation: 226

If you are referring to the actual size of the produced output (pdf, png, etc), you can configure it with the width and height parameters. Check this link for png,bpm, etc, and this link for PDF format.

A MWE is something like this:

png("mygraph.png", heigh=400, width=600)
#functions to plot your graph
dev.off()

If you are referring to the size of the graphic produced by the layout function, as @MrFlick referred, you should check the parameters of the particular layout you are using.

Hope it helps you.

Upvotes: 6

Related Questions