2014b Subplot legend zoom error
Show older comments
Hi,
since Matlab 2014b, the attached code results in various errors, if the user zooms into the first subplot:
Attempt to reference field of non-structure array.
Error in matlab.graphics.internal.SubplotListenersManager/isManaged (line 76)
Error in matlab.graphics.shape.internal.AxesLayoutManager/getSubplotLayoutManager (line 400)
Error in matlab.graphics.shape.internal.AxesLayoutManager/enableAxesDirtyListeners (line 1063)
Error in zoom>local2DButtonUpFcn (line 1392)
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeWindowButtonUpFcn (line 55)
hgfeval(newButtonUpFcn,hFig,evd);
Error in matlab.uitools.internal.uimode/setCallbackFcn>localModeWindowButtonUpFcn (line 56)
hThis.modeWindowButtonUpFcn(hFig,evd,hThis,newButtonUpFcn);
Error while evaluating Figure WindowButtonUpFcn
If I erase the legend, the error does not occur. Also, if both plots have the same height.
Any ideas how to fix this?
2 Comments
EDIT:
After using your test file I can see most of my suppositions are incorrect. It does seem to be very simple.
Original Post:
I have this same problem as well. It will occur when zooming in some linked subplots but not others. It will also occur when brushing some subplots but not all the time.
I haven't figured out any way to fix it though and doing things like removing the legends doesn't seem to help. Removing the linkedaxes does not help either.
It will also occur after totally normal operation for a period of time and end up completely failing just showing the grey selection box whether or not the mouse is pressed and doing nothing. I'm still trying to create a 100% foolproof way to recreate the different errors.
My best guess at this time is that some zoom or brush action is still looking for the old subplot handle and when it is removed and replaced by a new subplot an error may occur.
Another strange aspect is that sometimes it will give that error but still work successfully as long as the subplots haven't been removed while they are zoomed in.
Justin
on 7 Jan 2015
I have submitted this as a bug report.
I can also cause it to happen when all the subplots are the same size and no legend is present. This is in more complex circumstances than the test.m file you gave and I have not been able to isolate individual cause at this time. I will add additional comments if I find out more.
Accepted Answer
More Answers (0)
Categories
Find more on Legend in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!