title: R: tmap Legend Formatting
body: <p>I am trying to create a function to map different variables for a specific state's school districts. However I a running into some problems formatting the legend. At the moment I have it laid out the best way to fit the maps(horizontally), but some of the text is being cut off (Below Average Poverty Rate), and I'd like to add % to the number labels in the legend. My code and an image of the legend is below. Any help you can provide would be very much appreciated. Thank You.</p>
  
  <pre><code>MakeLEAMap &lt;-function(StateNum,NCHE_VAR,VAR1_NAME,In,Folder){
    as.character(substitute(StateNum))
    as.character(substitute(NCHE_VAR))
    as.character(substitute(NCHE_In))
    as.character(substitute(VAR1_NAME))
    as.character(substitute(Folder))
  
    map &lt;- 
      tm_shape(LEA_1415_New[LEA_1415_New@data$STATEFP == StateNum, ]) +
      tm_polygons(NCHE_VAR,border.col="#000000", lwd= .5, textNA="Below Average \nPoverty Rate" ,  palette = 'Blues', style="quantile", 
                  title=paste(In," State LEA Map: ",VAR1_NAME),
                  legend.is.portrait = FALSE) +
      tm_text("LCITY", size=NCHE_VAR,scale=.8, root=2,print.tiny = FALSE, size.lowerbound = .85, bg.alpha = .75, 
              remove.overlap = TRUE,legend.size.show = FALSE, col="black") +
      tm_layout( legend.title.size = 3,
                frame = FALSE, inner.margins = c(0,.0,.05,.0), asp = 1.5,
                legend.text.size = 1, 
                legend.outside=TRUE, legend.outside.position = 'bottom',
                legend.frame = TRUE,
                legend.outside.size = .3, legend.position = c(-0.1, 0.3))
  
    save_tmap(map, filename=paste("State_Maps_TEST/",Folder,"/",In,".pdf", sep = ''),width=8, height=8 ) 
  }
  MakeLEAMap("48","Abv_Diff_Home_Pov","% Children in Poverty  minus \n% Children HCY (Ages5-17)", 
             "TX","ALL")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LQn6M.png" rel="nofollow noreferrer">Here is what the legend looks like now</a></p>