With legendflex, you can:
- position the legend relative to any object in any figure, not just the parent axis of whatever is being labeled
- organize legend text and symbols in a grid with a specified number of rows and/or columns
- rescale the horizontal space used by each legend symbol
- create multiple legends for the same axis
- add a title to the legend within the legend box
Note: R2014b-ready, sort of. Due to some bugs with figure resize callbacks in R2014b, you will encounter some crazy appearing/disappearing legend objects if you resize a figure in 2014b. Everything should settle out correctly after a few seconds, and I'm hoping to eventually recode to avoid these issues. Also, there appear to be a few bugs in the R2014b version of the legend command, which propagate through to this function (for example, trying to display a legend entry for a contour object results in a blank entry). I haven't been able to find any workarounds for that yet; please email me if you notice particular instances where legends are not rendered properly in 2014b.