Saturday, 15 June 2019

shapefile - Replicating QGIS color ramp style in R?


I want to use rgdal to plot a shapefile graduating the colour of features according to the values of one field (density). I couldn't find online detailed indications on how to do it and the package documentation doesn't explain the options for plot().


This is what I composed so far


library(rgdal)  


shapefile = "shapefile.shp"
map <- readOGR(dsn = shapefile, layer = "shapefile", verbose=FALSE)

plot(map, xlim = c(6.70, 18.32), ylim = c(35.2, 47.6), border=NA, add=TRUE)

This is the style in QGIS I am trying to replicate:


enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...