Rgraphviz and margins
1
1
Entering edit mode
@robert-stojnic-4721
Last seen 7.1 years ago
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 graph Rgraphviz • 826 views
ADD COMMENT
0
Entering edit mode
@sebastianwolf-9540
Last seen 5.7 years ago

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 COMMENT

Login before adding your answer.

Traffic: 227 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6