[R] Saveing plot to multiple locations

Joel joda2457 at student.uu.se
Mon Sep 13 11:32:39 CEST 2010


Hi 
Im trying to save a plot both to a pdf and as just a picture but without
success so if someone can help me I would be happy :)

my code:	

require(party)
irisct <- ctree(Species ~ .,data = iris)
data(iris)
attach(iris)
pdf('/home/joel/Skrivbord/mammamu.pdf')
try(png('/home/joel/Skrivbord/mammamu1.png'))
plot(Sepal.Length, Petal.Length, col=unclass(Species)) 
legend(4.5, 7, levels(Species), col=plot_colors, cex=0.8, fill=1:3)
try(png('/home/joel/Skrivbord/mammamu2.png'))
plot(irisct)
dev.off()
readBin(pic,'raw',1024*1024) 
readBin('/home/joel/Skrivbord/mammamu2.png','raw',1024*1024)

Ive tryed to move around the png and pdf part to see if it worked better if
they where in an other order but as I said without success.

//Joel
-- 
View this message in context: http://r.789695.n4.nabble.com/Saveing-plot-to-multiple-locations-tp2537133p2537133.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list