Exporting Figure as Vector Content File
5 次查看(过去 30 天)
显示 更早的评论
I am on 2021b version trying to use the exportgraphics function to export my figure to a .eps vector graphics file for figure composition in Adobe Illustrator.
Below is the code I am using to accomplish this.
ax = gca;
exportgraphics(ax,'FileName.eps','ContentType','vector')
The issue I am having is the figure in the .eps file is missing components.
See below for what is expected:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431973/image.png)
Here is the .eps output of the export function:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431978/image.png)
So it looks like not only is the alpha of the patch objects altered, but the line objects are just not there. Everything else looked fine to me. How can I correct this? I have tried using export_fig from the fileshare but there are issues with M1 Mac compatibility: see issue #352 https://github.com/altmany/export_fig/issues/352
0 个评论
回答(1 个)
Parth Saraf
2023-7-11
Hi,
Can you try doing similar to this code?
figure;
plot(1:10, rand(1,10));
exportgraphics(gcf, 'figure.eps', 'ContentType', 'vector')
You can also check this page Save Plot as Image or Vector Graphics File - MATLAB & Simulink - MathWorks India for more details.
Hope it helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!