Search code examples
matlabuser-interfacematlab-figurevector-graphicsmatlab-guide

Save Matlab GUI as vector graphics


I would like to present my Matlab GUI in a big poster, so I would like to safe it as a vector graphic and not just take a screenshot.

Is there an easy way to do that?

I am using matlab 2014a on OSX Mavericks


Solution

  • When you create a gui in matlab, you must have a matched *.fig file

    Then you can use

    fig=openfig('mygui.fig');
    print(fig,'-dpdf','test.pdf')
    

    or

    fig=openfig('mygui.fig');
    saveas(fig,'test.pdf')
    

    Also you can control very options like

    fig=openfig('mygui.fig');
    fig.InvertHardcopy = 'off';  %background
    set(fig,'PaperPositionMode','auto'); % size position
    print(fig,'-dpdf','test.pdf')