Export Matlab figures to Illustrator
New, since about 2022
To export a Matlab graphics object as vector graphics, use
exportgraphics(obj, filename, 'ContentType', 'Vector')
For example, to export the current axes as a PDF, use:
exportgraphics(gca,'myfile.pdf','ContentType','Vector');
See the help page here
In the olden days, before about 2022:
To export figures in Matlab to Illustrator, do the following:
Select your figure. Now, choose File menu, Save As...
Save the file as an .eps file (encapsulated postscript file)
In Illustrator, you can open this .eps file
The objects in the figure are likely to be "grouped". If this is not what you want, select the objects and choose Ungroup from the Object menu.
The various parts of the figure are further likely to be organized into structures that you may or may not want. The 3 structure types that are common are:
Clipping mask (you can release this by selecting the objects that are collected and choosing Object menu, Clipping mask submenu, Release Clipping Mask).
Compound path (you can release this by selecting the objects that are collected and choosing Object menu, Compound path submenu, Release Compound Path).
Grouping (you can release items in a group by choosing Object menu, Ungroup).
Common issue: my plot comes through as an image instead of vector graphics!
Solution: Set the 'renderer' of your figure to 'painters'. Suppose the figure you are viewing in Matlab is Figure 1 (viewing in Matlab, before you export). Then call set(1,'renderer','painters') and do your Save as..eps again.
Common issue: my image (like a photo or surface plot) comes through with low resolution!
Solution: save the image as a TIF ( imwrite(A,cmap,filename) ) and import the TIF to Illustrator. It's best to explicitly set the color map so that it comes through correctly in Illustrator.