[R-sig-Geo] Need to plot all 5 spatial maps together in a single window

Ranjeet Kumar Jha r@njeetjh@||tkgp @end|ng |rom gm@||@com
Thu Jun 9 07:28:29 CEST 2022


Hi,

I like to plot all my 5 spatial maps of drought indices in a single window
using the sf plot function in R. I am able to plot all maps separately but
unable to plot altogether. All indexes are showing drought indices.

I really appreciate your help!

Here is the code:

#merging using merge function
merge_drought_indices <- merge(shp_dist, drought_indices)
view(merge_drought_indices)
#plot in a single window
library(sf)
par(mfrow=c(2,2))
 plot(merge_drought_indices["r_count_lt_p05_harvest_end"],
 pal = colorRampPalette(c("red", "white", "blue","green")),
 main = "End harvest index variation in India during drought year 2000",
 key.pos = 4, axes = TRUE, key.width = lcm(1.3), key.length = 1.0)

 plot(merge_drought_indices["r_count_lt_p05_harvest"],
 pal = colorRampPalette(c("red", "white", "blue","green")),
 main = "Harvest variation index in India during drought year 2000",
 key.pos = 4, axes = TRUE, key.width = lcm(1.3), key.length = 1.0)

 plot(merge_drought_indices["r_count_lt_p05_main"],
 pal = colorRampPalette(c("red", "white", "blue","green")),
 main = "Main growth stage index variation in India during drought year 2000",
 key.pos = 4, axes = TRUE, key.width = lcm(1.3), key.length = 1.0)

 plot(merge_drought_indices["r_count_lt_p05_plant.start"],
 pal = colorRampPalette(c("red", "white", "blue","green")),
 main = "Plant start index variation in India during drought year 2000",
 key.pos = 4, axes = TRUE, key.width = lcm(1.3), key.length = 1.0)

 plot(merge_drought_indices["r_count_lt_p05_plant"],
 pal = colorRampPalette(c("red", "white", "blue","green")),
 main = "main plant stage index variation in India during drought year 2000",
 key.pos = 4, axes = TRUE, key.width = lcm(1.3), key.length = 1.0)


Regards and Thanks,

Ranjeet


-- 



*"Simple Heart, Humble Attitude and Surrender to Supreme Being make our
lives beautiful!"*

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list