custom function to set upper and lower margins to legend title in ggplot2
legend_title_margin(plot, t.margin = unit(0, "mm"), b.margin = unit(3,
"mm"))
Plot with the legend title whose margins need to be modified.
Margins in grid units.
A plot with desired margins between the legend title and the legend.