Question: Rgraphviz and margins
1
gravatar for Robert Stojnic
7.8 years ago by
Robert Stojnic80 wrote:
Hello, I am using Rgraphviz, first by calling layoutGraph() then renderGraph() on graphNEL. However, I cannot get the graph to be rendered with certain margins. I've tried the oldfashioned par(mar=...), tried passing the margin parameters to both layoutGraph and renderGraph, but nothing worked. The plot always take all the available area. Setting outer margins does work (with par), but breaks in the context of multiple plots per page. Anyone know how to set margins in Rgraphviz? Cheers, Robert
graph rgraphviz • 552 views
ADD COMMENTlink modified 3.3 years ago by sebastian.wolf0 • written 7.8 years ago by Robert Stojnic80
Answer: Rgraphviz and margins
0
gravatar for sebastian.wolf
3.3 years ago by
sebastian.wolf0 wrote:

I found it in the Code.

 

These lines say you have to set "sub" and "main", this gets you top and left margins

 

> sub <- getRenderPar(x, "sub", "graph")
> main <- getRenderPar(x, "main", "graph")

 

Set them relatively by:

> mylist$main<-5 # maintitle
> mylist$sub<-5 # subtitle
> mylist$margin <- c(5,5,5,5)
> graphRenderInfo(x)<-mylist

or add to renderGraph.R

>  margin <-  getRenderPar(x, "margin", "graph")
>  old.pars <- par(mai=margin)
ADD COMMENTlink modified 3.3 years ago • written 3.3 years ago by sebastian.wolf0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 374 users visited in the last hour