I'm running into an issue where I've attached the following to a figure:
figHandle.SizeChangedFcn = @(src,event) set(src.Children(3),'Position',get(src.Children(end),'Position'));
The goal of this is to move a specific element (in this case, a legend), in line with a second element (another legend for the primary axes). If relevant, the idea is to move the legend of an invisible axes in line with the legend already associated with the visible one. I have two questions:
- The invisible axes don't scale like the other axes. The first is one with many lines plotted on it, while the second is a bar plot, drawn with the intention of creating a color code for an img plotted on the same space. the reason for this legend related callback is because for whatever reason, I can't make the axes scale identically. Is there some content I can load into the invisible axes that will solve this?
- In the event I can't get the two axes to scale identically, I need to make this callback work slighty differently. At the moment, making the function invisible leads to the callback being disabled for some reason - is there another callback which I may be able to take advantage of, which is triggered in the event of a resizing (or which I can enable to be so) which is not influenced by figure visibility.
Any help would be appreciated
11 Comments
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718408
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718408
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718705
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718705
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718709
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_718709
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720191
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720191
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720238
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720238
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720282
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720282
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720402
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_720402
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_721767
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_721767
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_722129
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_722129
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_722297
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_722297
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_723306
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/468894-resizing-callbacks-with-invisible-figures#comment_723306
Sign in to comment.