You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 5, 2019. It is now read-only.
MATLAB has released R2017a Prerelease to some users. In the release notes on page 1-3 under Graphics, it is mentioned the legend function now supports the following behaviour.
Create legends that update when data is added to or removed from the axes
This is partially what legtools is intended for, so legtools could be updated to remain compatible with this new functionality (e.g. make use of it?) while retaining support for older MATLAB versions.
Thanks for the heads up, this was something I noticed as well going through the prerelease notes.
With AutoUpdate enabled:
legtools.append no longer works, MATLAB ignores the extra legend entry since it's added its own
legtools.permute no longer works
legtools.remove no longer works
legtools.adddummy still functions, but the internal legtools.append call has the same issue as above
Yay!
Simply toggling AutoUpdate doesn't work with the current implementation, the extra entries are removed/added once it's turned back on. There's still a little bit of time until R2017a is officially released so some options will be explored to hopefully resolve the issues.
The recently published Undocumented MATLAB article may have yielded a more reliable approach to manipulating the legend entries to unbreak everything that was broken in R2017a.
hLegend.EntryContainer.NodeChildren seems to provide similar functionality to hLegend.PlotChildren, so there's a chance that legends in newer versions of MATLAB respect changes to this where it stopped respecting changes to PlotChildren.
I'll try to investigate over the weekend or early next week.
While the article doesn't seem to help like I was hoping it would, I did find an unrelated approach that seems to easily restore functionality to append and adddummy.
Activity
[-]Upcoming MATLAB release contains updating legend[/-][+]Upcoming MATLAB release supports autoupdating legend[/+]sco1 commentedon Dec 23, 2016
Thanks for the heads up, this was something I noticed as well going through the prerelease notes.
With
AutoUpdateenabled:legtools.appendno longer works, MATLAB ignores the extra legend entry since it's added its ownlegtools.permuteno longer workslegtools.removeno longer workslegtools.adddummystill functions, but the internallegtools.appendcall has the same issue as aboveYay!
Simply toggling
AutoUpdatedoesn't work with the current implementation, the extra entries are removed/added once it's turned back on. There's still a little bit of time until R2017a is officially released so some options will be explored to hopefully resolve the issues.sco1 commentedon Jul 13, 2018
The recently published Undocumented MATLAB article may have yielded a more reliable approach to manipulating the legend entries to unbreak everything that was broken in R2017a.
hLegend.EntryContainer.NodeChildrenseems to provide similar functionality tohLegend.PlotChildren, so there's a chance that legends in newer versions of MATLAB respect changes to this where it stopped respecting changes toPlotChildren.I'll try to investigate over the weekend or early next week.
Restore append functionality for MATLAB >= R2017a
sco1 commentedon Jul 13, 2018
While the article doesn't seem to help like I was hoping it would, I did find an unrelated approach that seems to easily restore functionality to
appendandadddummy.Restore adddummy functionality for MATLAB >= R2017a