Hi again, As this problem seems to be related to plot.igraph I just open an issue in igraph-github page: https://github.com/igraph/rigraph/issues/69
For now the workaround I am using is to plot only the x-values contained in your xlim range, like below: library(igraph) g<-erdos.renyi.game(30,0.4) x<-1:100; par(mfrow=c(2,2)); hist(degree(g),main="A"); plot(x[40:90],sin(x[40:90]),type="l",xlab="x",ylab="sin(x)",xlim=c(40,90),main="D") plot(g,main="C");box(); plot(x[40:90],sin(x[40:90]),type="l",xlab="x",ylab="sin(x)",xlim=c(40,90),main="D") Best, Charles On Fri, Apr 17, 2015 at 8:09 PM, Charles Novaes de Santana < [email protected]> wrote: > By the way[2]: The problem persists is I use par(mfrow=c(2,2)) instead of > layout. Please test with the following code: > > library(igraph) > > g<-erdos.renyi.game(30,0.4) > x<-1:100; > > par(mfrow=c(2,2)); > hist(degree(g),main="A"); > plot(x,sin(x),type="l",xlab="x",ylab="sin(x)",xlim=c(40,90),main="B") > plot(g,main="C");box(); > plot(x,sin(x),type="l",xlab="x",ylab="sin(x)",xlim=c(40,90),main="D") > > So, it is one more evidence that the problem should be caused by the > igraph.plotting. Any idea? > > Best. > > Charles > > On Fri, Apr 17, 2015 at 3:06 PM, Charles Novaes de Santana < > [email protected]> wrote: > >> By the way: I am running igraph 0.7.1 with R 3.0.2 in Ubuntu 14.04. >> >> Best, >> >> Charles >> >> On Fri, Apr 17, 2015 at 2:47 PM, Charles Novaes de Santana < >> [email protected]> wrote: >> >>> Dear all, >>> >>> I am trying to plot 4 different plots in the same figure using >>> graphics::layout to organize the plots. The code below reproduces more or >>> less what I am doing: >>> >>> library(igraph) >>> >>> g<-erdos.renyi.game(30,0.4) >>> x<-1:100; >>> >>> >>> m<-rbind(c(1,1,1,2,2,2),c(1,1,1,2,2,2),c(1,1,1,2,2,2),c(3,3,3,4,4,4),c(3,3,3,4,4,4),c(3,3,3,4,4,4)); >>> layout(m); >>> >>> hist(degree(g),main="A"); >>> plot(x,sin(x),type="l",xlab="x",ylab="sin(x)",xlim=c(10,60),main="B") >>> plot(g,main="C");box(); >>> plot(x,sin(x),type="l",xlab="x",ylab="sin(x)",xlim=c(10,60),main="D") >>> >>> My problem is that the curve plotted in "D" (that is exactly the same as >>> in "B") is shown out of the margins. I suppose it is out of margins because >>> I plot a graph right before "D". >>> >>> Does any of you have any idea if plotting a graph can have any effect in >>> the margins of the next plot? Any clue about how to solve this problem? >>> >>> Thanks for your attention, >>> >>> Charles >>> -- >>> Um axé! :) >>> >>> -- >>> Charles Novaes de Santana, PhD >>> http://www.imedea.uib-csic.es/~charles >>> >> >> >> >> -- >> Um axé! :) >> >> -- >> Charles Novaes de Santana, PhD >> http://www.imedea.uib-csic.es/~charles >> > > > > -- > Um axé! :) > > -- > Charles Novaes de Santana, PhD > http://www.imedea.uib-csic.es/~charles > -- Um axé! :) -- Charles Novaes de Santana, PhD http://www.imedea.uib-csic.es/~charles
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
