[R] using png and identify commands

Tom Wright tom at maladmin.com
Mon Feb 2 19:58:23 CET 2015


replacing png(...) and dev.off() with
dev2bitmap('test.png')
seems to work.

On Mon, 2015-02-02 at 15:56 -0200, Antonio Silva wrote:
> Hi R users
> 
> I want to save a plot after using the command identify.
> 
> I use identify to place labels manually near the points in order to avoid
> overlapping lines and numbers.
> 
> x<-c(1,2,3,4,5,6)
> y<-c(20,30,15,7,25,40)
> plot(x,y,type="b",ylim=c(0,45))
> identify(x,y,labels=y)
> 
> But when I add
> 
> png(filename="test.png",width=20,height=20,units="cm",res=300)
> x<-c(1,2,3,4,5,6)
> y<-c(20,30,15,7,25,40)
> plot(x,y,type="b",ylim=c(0,45))
> identify(x,y,labels=y)
> dev.off()
> 
> The plot is saved directly, without the identification of the points.My
> question is: how to save the plot only after having labelled the points.
> 
> I use R integrated to gedit in UBUNTU Trusty Tahr 64 bits. I'd like to save
> the plot using command lines and not GUIs
> 
> Thanks for any help. Best regards,
> 
> Antonio Olinto
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list