legendflex.m: a more flexible, customizable legend

Create a legend with more flexible positioning and labeling capabilities
16K Downloads
Updated 17 Jan 2025

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Cite As

Kelly Kearney (2025). legendflex.m: a more flexible, customizable legend (https://github.com/kakearney/legendflex-pkg), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: SETPOS 1.2 - GETPOS 1.2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

legendflex

setgetpos_V1.2

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.9.0.1

linked GitHub readme

1.9.0.0

Updated description (which was erased when the github link was added)

1.8.0.0

- Corrected some remaining R2014b bugs; all graphics handles should now be objects rather than numeric if running in R2014b or later.
- Switched source to github repository

1.7.0.0

Added note regarding legendflex with the Latex interpreter

1.6.0.0

Added parameter to modify padding between legend box and text/symbols

1.5.0.0

- updated for R2014b graphics

1.4.0.0

Now respects manual changes made by user (including legend height, width, and units) when resizing.

1.3.0.0

Fixed bug where very wide titles were not completely enclosed in legend box.

1.2.0.0

bug fixes: fixed error in function resize if you delete the legend, fixed minor vertical alignment issue

1.1.0.0

Figure resize now re-links legend and labeled objects with updated line/patch properties.

1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.