[R] using png and identify commands

Antonio Silva aolinto.lst at gmail.com
Mon Feb 2 18:56:27 CET 2015


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]]



More information about the R-help mailing list