________          ___       __   ________  ________  ___  __            ___  ________           ________  ________  ________  ________  ________  _______   ________   ________      
|\   __  \        |\  \     |\  \|\   __  \|\   __  \|\  \|\  \         |\  \|\   ___  \        |\   __  \|\   __  \|\   __  \|\   ____\|\   __  \|\  ___ \ |\   ____\ |\   ____\     
\ \  \|\  \       \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \/  /|_       \ \  \ \  \\ \  \       \ \  \|\  \ \  \|\  \ \  \|\  \ \  \___|\ \  \|\  \ \   __/|\ \  \___|_\ \  \___|_    
 \ \   __  \       \ \  \  __\ \  \ \  \\\  \ \   _  _\ \   ___  \       \ \  \ \  \\ \  \       \ \   ____\ \   _  _\ \  \\\  \ \  \  __\ \   _  _\ \  \_|/_\ \_____  \\ \_____  \   
  \ \  \ \  \       \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \\ \  \       \ \  \ \  \\ \  \       \ \  \___|\ \  \\  \\ \  \\\  \ \  \|\  \ \  \\  \\ \  \_|\ \|____|\  \\|____|\  \  
   \ \__\ \__\       \ \____________\ \_______\ \__\\ _\\ \__\\ \__\       \ \__\ \__\\ \__\       \ \__\    \ \__\\ _\\ \_______\ \_______\ \__\\ _\\ \_______\____\_\  \ ____\_\  \ 
    \|__|\|__|        \|____________|\|_______|\|__|\|__|\|__| \|__|        \|__|\|__| \|__|        \|__|     \|__|\|__|\|_______|\|_______|\|__|\|__|\|_______|\_________\\_________\
                                                                                                                                                               \|_________\|_________|
                                                                                                                                                                                      
                                                                                                                                                                                      
 ________          ___       __   ________  ________  ___  __            ___  ________      
|\   __  \        |\  \     |\  \|\   __  \|\   __  \|\  \|\  \         |\  \|\   ___  \    
\ \  \|\  \       \ \  \    \ \  \ \  \|\  \ \  \|\  \ \  \/  /|_       \ \  \ \  \\ \  \   
 \ \   __  \       \ \  \  __\ \  \ \  \\\  \ \   _  _\ \   ___  \       \ \  \ \  \\ \  \  
  \ \  \ \  \       \ \  \|\__\_\  \ \  \\\  \ \  \\  \\ \  \\ \  \       \ \  \ \  \\ \  \ 
   \ \__\ \__\       \ \____________\ \_______\ \__\\ _\\ \__\\ \__\       \ \__\ \__\\ \__\
    \|__|\|__|        \|____________|\|_______|\|__|\|__|\|__| \|__|        \|__|\|__| \|__|
                                                                                            
                                                                                            
                                                                                            
           ________  ________  ________  ________  ________  _______   ________   ________      
          |\   __  \|\   __  \|\   __  \|\   ____\|\   __  \|\  ___ \ |\   ____\ |\   ____\     
          \ \  \|\  \ \  \|\  \ \  \|\  \ \  \___|\ \  \|\  \ \   __/|\ \  \___|_\ \  \___|_    
           \ \   ____\ \   _  _\ \  \\\  \ \  \  __\ \   _  _\ \  \_|/_\ \_____  \\ \_____  \   
            \ \  \___|\ \  \\  \\ \  \\\  \ \  \|\  \ \  \\  \\ \  \_|\ \|____|\  \\|____|\  \  
             \ \__\    \ \__\\ _\\ \_______\ \_______\ \__\\ _\\ \_______\____\_\  \ ____\_\  \ 
              \|__|     \|__|\|__|\|_______|\|_______|\|__|\|__|\|_______|\_________\\_________\
                                                                         \|_________\|_________|
                                                                                                
                                                                                                

Exporting MATLAB figures to LaTeX

The standard way of exporting figures from MATLAB to LaTeX is to use the builtin print command to export the figure to an eps file using:

print -depsc $filename

Unfortunately figures exported this way generally do not look like the original MATLAB figures. The aspect ratio is different and the fonts are too small. This can be overcome by tweaking the paper size, the font size and the line thickness but the process is fiddly and resulting eps files are hard to use since alternative TeX compilers like XeTeX and LuaTeX do not support eps files out of the box.

Read more »