Plot 2 tmap objects side-by-side

后端 未结 3 502
野性不改
野性不改 2021-01-19 07:13

Example:

I want to plot two tmap plots side by side, which are generated by this code.

library(tmap)
library(gridExtra)

data(World)         


        
3条回答
  •  误落风尘
    2021-01-19 07:27

    I was wondering if in the meantime it has become possible to plot the 5 maps in the following example side by side without switching to tm_facets(ncol=5).

    data(NLD_prov, NLD_muni)
    
    tmap_mode("plot")
    tm_shape(NLD_muni) +
    tm_fill(c("pop_0_14", "pop_15_24", "pop_25_44", "pop_45_64", "pop_65plus"),
            style="kmeans", 
            palette=list("Oranges", "Greens", "Blues", "Purples", "Greys"),
            title=c("Population 0 to 14", "Population 15 to 24", "Population 25 to 44",
                    "Population 45 to 64", "Population 65 and older")) +
    tm_shape(NLD_prov) +
    tm_borders() +
    tm_format_NLD(frame = TRUE, asp=0)
    

提交回复
热议问题