[R-sig-Geo] Saving plot as PDF from functions levelplot and gplot from rasterVis package

baptiste auguie baptiste.auguie at googlemail.com
Fri Mar 23 03:46:22 CET 2012


My initial suggestion was to try panel.levelplot.raster with lattice,
and correspondingly geom_raster with ggplot2. Did you try it?

b.

On 23 March 2012 05:11, Manuel Spínola <mspinola10 at gmail.com> wrote:
> Thank you very much Paul,
>
> My problem now is with the output from gplot (rasterVis, ggplot2), the
> problem with levelplot was solved by the suggestion from Oscar Perpiñán.
>
> The map is at:
> https://docs.google.com/open?id=0B5pDw_grXll8a21uQzB5ZlRULWl3ZWZxdU44b2Nvdw
>
> mapa = read.asc("Ectophylla_alba.asc" ,gz=FALSE)
> image(mapa)
>
> write.asc(mapa, "mapar")
>
> maparaster = raster("mapar.asc")
>
> pdf("mpgplot.pdf")
> gplot(maparaster) + geom_tile(aes(fill = value))
> dev.off()
>
> Also, using ggsave (ggplot2) did not solve the problem.
>
> Best,
>
> Manuel
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola at una.ac.cr
> mspinola10 at gmail.com
> Teléfono: (506) 2277-3598
> Fax: (506) 2237-7036
> Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list