C.Colden
C.Colden

Reputation: 627

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

Upvotes: 0

Views: 536

Answers (3)

sun0727
sun0727

Reputation: 394

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')

Upvotes: 1

Dev-iL
Dev-iL

Reputation: 24169

What's wrong with saveas ?

Example: saveas(hFig,'filename','format'); and then save to any available vectoric format such as .emf (link to saveas doc).

Upvotes: 0

am304
am304

Reputation: 13876

You can try the print command and one of the EPS formats (-deps, -depsc, -deps2 or -depsc2).

EDIT

Here is a simple example using gcf to get the handle of the current figure:

print(gcf,'-deps','test.eps') % using EPS format
print(gcf,'-dpdf','test.pdf') % using PDF format

Upvotes: 1

Related Questions