質問

I am currently using the excellent script *export_fig* to export figures from MATLAB for use in a journal paper I am writing. This file works perfectly for raster images (bmp, tiff, etc) but I really want to export my figures to a vector format. I have 2 options, eps or pdf. Exporting to pdf is fine but when I export to eps, I notice that all the font in the figure (axes labels, legend font) appears to be thickened somewhat. This isnt the case when I export to pdf so I have no idea why it is happening, hopefully someone has come across this issue before?

I have tried changing the default font before exporting but the issue persists. Also, and interestingly, when I open the exported figure in pdf format it looks fine, but when I publish it from pdf to eps using Adobe Acrobat Pro, the same problem occurs. The resultant eps now has thickened fonts (a bit like the font is in bold).

Any help would be appreciated.

役に立ちましたか?

解決

I faced the same issue in all versions of matlab. I always get a different font in the exported eps file.

So here is one method i use each time.

Save a MATLAB fig file with the formatting you want for different elements e.g labels etc. Export eps/pdf from this and verify if it is ok for you.

Now the simple trick is to execute your program without plotting figures.

1) Import the above mentioned saved fig file in to matlab and open plot editor. 2) Delete its variables from plot brower 3) Import your variables which you want to plot (click on figure and then click add data tab in plot brower) 4) update label and title (text only, no font changes) 5) Save file as .fig and also export to eps.

You are done and you get the same formatting in each figure you generate like this.

It is a time consuming process but gets your job done. Also in case you want the formatting of a fig file saved with other version of MATLAB this method works, even if OS is changed or fonts are upgraded.

他のヒント

I have found the best way to export a vector image is to use the Metafile format which is a true vector format. The pdf file you get when you use the print command shows compression artifacting when you zoom in.

Here are 3 options for putting a Metafile into PowerPoint or Word:

  1. In the Matlab figure window, select Edit / Copy Figure from the menu, then paste into Word, PowerPoint, Outlook, etc. For line graphs, I usually make the lines thicker before copying, you can do this by selecting Edit / Copy Options, then select "Figure Copy Template" on the left side of the dialog box, then click on the "Power Point" button, then click on "Apply to Figure".

  2. You can use this command to copy the Metafile to the clipboard print -dmeta, then paste into Word, PowerPoint, etc.

  3. You can write the metafile to disk, then you can just drag and drop the file from Windows Explorer onto a PowerPoint slide or from the Insert Ribbon, select "file" and pick the appropriate .emf file. To write the emf file to your disk, give a command like this: print('-dmeta', 'myfile')

This will create a file called "myfile.emf" on your hard disk.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top