Note that there are some explanatory texts on larger screens.

plurals
  1. POR: Gradient plot on a shapefile
    text
    copied!<p>I currently have a shapefile of the UK and have plot the population of species in different regions of the UK. So far I have just plotted 3 levels of species population and coloured them red=high, orange=med, green=low. But what I would like to do would be to have a gradient plot instead of being bounded by just 3 colours. So far I have a table called Count that has the regions as the column names and then the count of species for each region below. My lowest count being 0 and my highest being around 2500 and the regions in Count match with the regions in my shapefile. I have a function that determines what is high, med, low based on levels you input yourself </p> <pre><code> High&lt;-colnames(Count)[which(Count&gt;'input value here')] </code></pre> <p>and then these are plotted onto the shapefile like this:</p> <pre><code> plot(ukmap[(ukmap$Region %in% High),],col='red',add=T) </code></pre> <p>Unfortunately I can't really install any packages, I was thinking of using colorRamp, but I'm not really sure what to do?</p> <p>EDIT: my data looks something like this</p> <pre><code> Wales Midlands North Scotland South East South West 1 551 32 124 1 49 28 3 23 99 291 152 164 107 4 1 7 17 11 21 14 7 192 32 12 0 1 9 9 98 97 5 1 21 0 </code></pre> <p>and the first column is just a number that represents the species and currently I have a function that plots the count onto a UK shapefile but based on boundaries of high, med and low. The data above is not attached to my shapefile. I then loop through for each line (species) of my data set and plot a new map for each line (species).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload