|
From: Sarawut N. <sar...@gm...> - 2010-07-01 04:31:55
|
Hi list,
I try to make plot with 2 line object and showing legend both of them.
But I got an error about
Error in plot.xy(xy.coords(x, y), type = type, ...) :
invalid plotting symbol
my code is below. It works if I comment graphic.legend line.
grdevices = importr('grDevices')
graphics = importr('graphics')
grdevices.png('testchart.png', width = 733, height = 550)
graphics.plot(wave,data,type="p",xlim=robjects.IntVector([500,2400]),xlab="Wavelength",ylab="Reflectance",pch=1,col="black")
graphics.lines(wave,data2,type="p",lty=1,lwd=1,pch=19,col="red")
graphics.legend('topleft',legend=['test','test2'],lty=2,pch=[1,19],col=["black","red"])
graphics.title("Plot graph")
grdevices.dev_off()
Please advise me for a solution.
Best regards
Sarawut
|