MATLAB: Printing Axes

print axesprint figure

Hi everybody
I have 8 axes in my gui . How can i print three of them ? 'print' function is print all figure window. I don't want to print all of figure.
Thanks for help…

Best Answer

With export_fig you can specify a list of handles of the axes to print, and only these axes will be printed. E.g.:
figure;
for a = 1:4
hax(a) = subplot(2,2,a);
plot(rand(3));
end
export_fig(hax([1 3]), 'test.png');
It essentially implements Daniel's suggestion, so you don't have to. However, it may not work perfectly with GUIs as they tend to behave differently. Try it, though.