title: Add annotation and segments to groups of legend elements
body: <p>My ggplot has the following legend:<br>
  <a href="https://i.stack.imgur.com/PmJp3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PmJp3.png" alt="enter image description here"></a></p>
  
  <p>I want to group my individual legend variables, and add the group names and "brackets" like shown in legend below:<br>
  <a href="https://i.stack.imgur.com/H3eYk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H3eYk.png" alt="enter image description here"></a></p>
  
  <p>My data has 2 columns:<br>
  1 - States of USA<br>
  2 - Activity level which has a range from 10 (High) - 1 (Low)<br></p>
  
  <p>I am also using data -<br> us&lt;-map_data("state"), which is included in ggplot/map package.<br><br>
  My code:<br>    </p>
  
  <pre><code>ggplot()+ geom_map(data=us, map=us,aes(x=long, y=lat, map_id=region),
                  fill="#ffffff", color="#ffffff", size=0.15) +
  geom_map(data=dfm4,map=us,aes(fill=ACTIVITY.LEVEL,map_id=STATENAME)
  ,color="#ffffff", size=0.15)+  
  
  scale_fill_manual("Activity",
  values=c("10"="red4","9"="red2","8"="darkorange3",
  "7"="orange3","6"="orange1",                                        
  "5"="gold2","4"="yellow","3"="olivedrab3","2"="olivedrab2",
  "1"="olivedrab1"),
  breaks=c("10","9","8","7","6","5","4","3","2","1"),
  labels=c("High - 3","High - 2","High - 1","Moderate - 2","Moderate - 
  1","Minimal - 2","Minimal - 1","Low - 3","Low - 2","Low - 1"))+
  labs(x="Longitude",y="Latitude")
  </code></pre>
  
  <p>Reproducible data:<br></p>
  
  <pre><code>state&lt;-c("alabama", 
  "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", 
  "delaware", "district of columbia", "florida", "georgia", "hawaii", 
  "idaho", "illinois", "indiana", "iowa", "kansas", "kentucky", 
  "louisiana", "maine", "maryland", "massachusetts", "michigan", 
  "minnesota", "mississippi", "missouri", "montana", "nebraska", 
  "nevada", "new hampshire", "new jersey", "new mexico", "new york", 
  "new york city", "north carolina", "north dakota", "ohio", "oklahoma", 
  "oregon", "pennsylvania", "puerto rico", "rhode island", "south carolina", 
  "south dakota", "tennessee", "texas", "utah", "vermont", "virgin islands", 
  "virginia", "washington", "west virginia", "wisconsin", "wyoming")
  
  activity&lt;-c("10", "10", "10", "10", 
  "8", "8", "6", "10", "10", "1", "10", "6", "4", "10", "10", "7", 
  "10", "10", "10", "2", "10", "10", "9", "9", "10", "10", "2", 
  "10", "8", "10", "10", "10", "10", "10", "3", "8", "10", "8", 
  "10", "10", "10", "10", "10", "10", "7", "10", "10", "1", "10", 
  "7", "10", "10", "9", "5")
  
  reproducible_data&lt;-data.frame(state,activity)
  </code></pre>