# Changes between Version 2 and Version 3 of udg/ecoms/RPackage/examples/continentalSelection

Ignore:
Timestamp:
Feb 20, 2014 2:27:15 PM (8 years ago)
Comment:

--

### Legend:

Unmodified
 v2 Plotting objects inheriting from this class or related classes (e.g. SpatialGridDataFrame) is straightforward using the spplot methods, as described in [wiki:../Trellis the previous example], but it is not directly usable as input for other plotting methods in R. Next, we present some typical plotting functions and how to extract the spatial coordinates in a suitable format for plotting. The total precipitation field is calculated as the total accumulated precipitation during the selected period for each model grid cell: {{{ tp <- colSums(monsoon$MemberData$Member_16) }}} And this is the classical way of displaying the data using the spplot method: {{{ sgdf <- SpatialGridDataFrame(monsoon\$LonLatCoords, as.data.frame(tp)) data(world_map) wl <- as(world_map, "SpatialLines") wlines <- list("sp.lines", wl) spplot(sgdf, scales = list(draw = TRUE), sp.layout = list(wlines), col.regions = rev(topo.colors(41))) }}} [[Image(spplot.png)]] It is also straightforward to represent the precipitation using contour lines: {{{ spplot(sgdf, scales = list(draw = TRUE), contour = TRUE, col = "red", col.regions = rev(topo.colors(41))) }}} [[Image(spplot_contour.png)]]