Guide Exporting Figures - UQ-Communication-Systems/public GitHub Wiki

MATLAB

f = figure()
% plot....

% save as different formats
saveas(f, 'image.eps')
saveas(f, 'image.png')

Octave

The current figure in octave can be saved to a file with the print command. For example:

plot(x, y); % plot like normal (replace with your normal plot type)
print('output.eps', '-depsc2'); % output to "output.eps" 

The current figure is saved to file output.eps. EPS files can be read by Latex, Word, etc.

Also on the command line you can convert to PDF by using

epstopdf output.eps

Python

plt.figure(figsize=(12,5))
plt.plot(....)

# saving in different formats
plt.savefig('output.pdf', bbox_inches='tight')
plt.savefig('output.png', dpi=300, bbox_inches='tight')