Note that there are some explanatory texts on larger screens.

plurals
  1. POPlotting a map with lines density in place of colours in R: legend and lines
    text
    copied!<p>I have data about relative productivity for the Italian provinces. I built 5 groups according to the productivity level. Finally I want to represent such a scenario using a map of the Italian provinces, given that I CAN NOT use colours, since the printing of the map will be in a scale grey. I used the following:</p> <pre><code>library(spdep) library(spectralGP) library(maptools) library(gstat) library (RColorBrewer) plot(submap.a,col="beige",border="Black",axes=T, xlim=c(7,20), ylim=c(36,48)) plot(submap.b,col="darkgrey",border="Black",add=T) plot(submap.c,col="black",border="Black",add=T,density=24) plot(submap.d, col="grey30",border="Black",add=T) plot(submap.e,col="grey13",border="Black", add=T) </code></pre> <p>where, for simplicity, the five groups are a,b,c,d,e</p> <p>The result is here <a href="http://s9.postimg.org/m5co5g3nz/Rplot.png" rel="nofollow">http://s9.postimg.org/m5co5g3nz/Rplot.png</a></p> <p>I d like to do 2 more things I was not able to figure out.</p> <p>First I need to add the legend, I tried with</p> <pre><code>legend_map &lt;- c("a", "b","c", "d", "e") legend(17,47,legend=legend_map,fill=c("white","darkgrey", ??,"grey30","grey13"),bty="n",cex=0.6) </code></pre> <p>I am not able to find a way to insert a code for group (c) in place of the ??. I tried with </p> <pre><code>"black"[density=24] "black"$density=24 </code></pre> <p>but they dont work</p> <p>Secondly, for things look clearer, I may want to fill group (e) provinces with the same style of group (c) but with lines going to the inverse direction or even vertically. Even in this case I was not able to deal with it.</p> <p>Thank you</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