Opening a saved fig file in R2014b is very slow when axes are linked

1 Ansicht (letzte 30 Tage)
Spotted some unusual behaviour recently. If I create a figure with subplots (see below) and linkaxes, save it and then reopen it, it takes approx 15 mins to open the fig, with one processor on my machine being used at 100% for all of that time. The figure opens in about a 1s if linkaxes isn't used. This behaviour isn't seen in older releases (I tried it in 09a). I assume it is a problem with linkaxes but wondered if anyone had a bright idea for a work around (other than ensuring axes aren't linked before saving!)? Linked and unlinked versions of the figure as generated on my machine attached.
Thanks,
Paul.
data=rand(6,10000);
figure
for i=1:6
ax(i) = subplot(6,1,i);
plot(data(i,:))
end
linkaxes(ax)

Akzeptierte Antwort

Anish Mitra
Anish Mitra am 23 Feb. 2016
It looks like this might have been a reported bug, that has been fixed. You could try and check if the issue still persists in R2015a.
For R2014b, a workaround could be to not link axes before saving, but create a custom script that opens the figure and links the axes.
% Open the figure and save the handle in f
f = openfig('yourfigure.fig');
% Get the children of the figure
c = f.Children;
% This compares the children "type" with "axes" to get the correct indices
idx = strcmp(get(c,'type'),'axes')
% Get these axes from the figure's children
a = c(idx);
% Link the axes
linkaxes(a,'x');

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by