Questions about using "xyplot" and plot device function such as "jpeg"
1
0
Entering edit mode
li lilingdu ▴ 450
@li-lilingdu-1884
Last seen 6.6 years ago
Hi,there, I ran into some problems when using Graphics Devices functions combined with "xyplot" function from "lattice" package. ============================================= data(quakes) Depth <- equal.count(quakes$depth, number=8, overlap=.1) jpeg("3.jpeg") xyplot(lat ~ long | Depth, data = quakes) dev.off() ###it's ok for(ind in 1:10){ jpeg(paste((1:10)[ind],".jpeg",sep="")) xyplot(lat ~ long | Depth, data = quakes) dev.off() } ###does not work, all jpeg files are empty. ============================================= any suggestions? --- LiGang [[alternative HTML version deleted]]
• 1.1k views
ADD COMMENT
0
Entering edit mode
Artur Veloso ▴ 340
@artur-veloso-2062
Last seen 10.3 years ago
Hi LiGang, When using xyplot in a loop you need to add the print command. This should work: for(ind in 1:10){ jpeg(paste((1:10)[ind],".jpeg",sep="")) print(xyplot(lat ~ long | Depth, data = quakes)) dev.off() } Cheers, Artur Veloso On Tue, Sep 2, 2008 at 12:54 AM, LiGang <luzifer.li@gmail.com> wrote: > Hi,there, > > I ran into some problems when using Graphics Devices functions combined > with > "xyplot" function from "lattice" package. > > > ============================================= > data(quakes) > Depth <- equal.count(quakes$depth, number=8, overlap=.1) > > > jpeg("3.jpeg") > xyplot(lat ~ long | Depth, data = quakes) > dev.off() > ###it's ok > > > > for(ind in 1:10){ > jpeg(paste((1:10)[ind],".jpeg",sep="")) > xyplot(lat ~ long | Depth, data = quakes) > dev.off() > } > > ###does not work, all jpeg files are empty. > > ============================================= > > any suggestions? > > --- > LiGang > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 421 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6