MATLAB Answers

Linkprop not working as expected on a reloaded figure of subplots

1 view (last 30 days)
Richard
Richard on 14 Jan 2017
Edited: Richard on 15 Jan 2017
I'm using the linkprop function on a grid of surface subplots (R2014b). The grid is 3x4 with columns 2,3,4 begin rotated using the View property. This works fine when I create the figure originally and modify the View property, but when I reload the figure and recover the subplot handles the first subplot blanks out as soon as I change the view. All the appropriate subplots do rotate, but the data has disappeared from the first subplot. I've included the simple test code that I execute after opening the figure and a jpg of the result (just showing two of the subplots. The blank subplot should have like data, but all properties have disappeared. When I step through the code the first subplot "blanks" as soon as the hsub(1) assignment is executed, but the subsequent subplots are unaffected during the subsequent assignments.
Update: I suspect this is a "bug", but an easy workaround in the example is to include one of the empty subplots in the linkprop, then simply make that subplot invisible.
hsub(1) = subplot(3,4,2);
hsub(2) = subplot(3,4,3);
hsub(3) = subplot(3,4,4);
hsub(4) = subplot(3,4,6);
hsub(5) = subplot(3,4,7);
hsub(6) = subplot(3,4,8);
hsub(7) = subplot(3,4,10);
hsub(8) = subplot(3,4,11);
hsub(9) = subplot(3,4,12);
hsub(10) = subplot(3,4,1);
hlink = linkprop(hsub,'View');

Answers (0)

Community Treasure Hunt

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

Start Hunting!