Dear R-users, I am using R(a package igraph) to calculate certain topological features of networks. When I try to draw a plot between these features I get an error. Following is the code I am using : *> plot(met_eco_deg,met_eco_bet)> lmout<-lm(met_eco_bet ~ met_eco_deg) > abline(lmout)Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet* *met_eco_deg* and *met_eco_bet* are the two objects generated from igraph package. I don't get any error when I just use the plot function. Can anyone help me out ?Thanks in advance. Regards, Anupam Sinha [[alternative HTML version deleted]]
Thanks a million for your suggestion. It works. On Mon, Jul 13, 2009 at 2:29 PM, Alain Guillet <alain.guillet@uclouvain.be>wrote:> Hello, > > The error message says there is no opened graphical windows. You cannot use > abline if there is no open graphical windows. Try this: > > plot(met_eco_deg,met_eco_bet) > abline(lmout) > > Regards, > Alain > > > > > anupam sinha wrote: > >> Dear R-users, >> I am using R(a package igraph) to calculate certain >> topological features of networks. When I try to draw a plot between these >> features I get an error. Following is the code I am using : >> >> *> plot(met_eco_deg,met_eco_bet) >> >> >>> lmout<-lm(met_eco_bet ~ met_eco_deg) >>> abline(lmout) >>> >>> >> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : >> plot.new has not been called yet* >> >> *met_eco_deg* and *met_eco_bet* are the two objects generated from igraph >> package. I don't get any error when I just use the plot function. Can >> anyone >> help me out ?Thanks in advance. >> >> >> Regards, >> >> Anupam Sinha >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> >> > > -- > Alain Guillet > Statistician and Computer Scientist > > SMCS - Institut de statistique - Université catholique de Louvain > Bureau d.126 > Voie du Roman Pays, 20 > B-1348 Louvain-la-Neuve > Belgium > > tel: +32 10 47 30 50 > >[[alternative HTML version deleted]]
Hi r-help-bounces at r-project.org napsal dne 13.07.2009 10:45:50:> Dear R-users, > I am using R(a package igraph) to calculate certain > topological features of networks. When I try to draw a plot betweenthese> features I get an error. Following is the code I am using : > > *> plot(met_eco_deg,met_eco_bet) > > lmout<-lm(met_eco_bet ~ met_eco_deg) > > abline(lmout) > Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : > plot.new has not been called yet* > > *met_eco_deg* and *met_eco_bet* are the two objects generated fromigraph> package. I don't get any error when I just use the plot function. Cananyone> help me out ?Thanks in advance.I do not have any experience in igraph but the error from abline states that plot is not initialised. I suspected that igraph is based on grid graphics and in this case you can not easily mix base and grid graphics, however from docs it seems that plain igraph plots are based on base graphics therefore it shall work. If your syntax is really only those 3 lines one after another do you see a plot after "plot(met_eco_deg,met_eco_bet)"? If not this is the problem. If after plot some plot appears and abline issues an error, than the problem is not so simple and without reproducible example it would be quite tricky to find out what is going on. Regards Petr> > > Regards, > > Anupam Sinha > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.