Resizing Callbacks with invisible figures
3 views (last 30 days)
Show older comments
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
Jan
on 8 Jul 2019
"it doesn't seem like it accepts arguments pairs" - Please post the code and show us, what let you assume, that arguments are not accepted. openfig() does not do any magic and you can inspect the code and modify a copy to satisfy your needs.
I do not understand the difference between: "make it visible on screen, then move and resize" and "make it visible, resize, then invisible". It is also not clear to me, why tic/toc matters here: If a code does not do, what you need, why does its speed play any rule? Did you include a drawnow insice the tic/toc?
Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!