0

I have several matlab figure I want to convert to pdf format for publication. I'm using the export_fig(gcf,'test.pdf','-transparent') command line, but the output pdf is different from the original figure (axes label, text box, anotations,... moved from their initial position).

Have you any idea how to get a WYSIWYG output ? Thanks !

John
  • 303
  • 4
  • 13

2 Answers2

0

Try

saveas(gcf, 'test.pdf', 'pdf')

See this post for removing the whitespace which MATLAB will put around.

If you want to avoid this, just save the figure as *.eps vector image. You can also include *.eps images in your latex publication.

saveas(gcf, 'test.eps', 'epsc')
gehbiszumeis
  • 3,525
  • 4
  • 24
  • 41
0

I found a way, but it have to be done manualy :

  • open the .fig file
  • select file > print preview
  • if the graph is too large, select format "A3" and orientation "landscape"
  • then "print"

For Latex, this orientation can causes some problems (even by using the trim ={. . . .},clip function in includegraphics), that is why I use the pdf rotation website : https://www.rotatepdf.net/

Hope it could be usefull, because NO NEED for more matlab function or code.

John
  • 303
  • 4
  • 13