mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
275 stars 182 forks source link

Cannot export EBSD map as a vector object #984

Open da-levy opened 3 years ago

da-levy commented 3 years ago

Hello,

I am trying to export my EBSD maps as vector-format files (ideally, PDF) so I can play with them in Adobe Illustrator (I want to overlay the EBSD map on a CL image I have of the same grain).

I am running into a few issues. The main issue is MATLAB will not export the EBSD data as a vector object (it is always an image) despite the scale, etc. being vector objects. I believe the issue is there are too many individual pixels in the EBSD data, and MATLAB cannot export these as vectors, so it defaults to making them a composite image. Using the MATLAB renderer 'Painters' is the usual way to circumvent this, however 'Painters' is not working for me in this case.

Has anyone dealt with this, or can think of a solution?

Much thanks, Drew

da-levy commented 3 years ago

I found a solution to this problem.

When setting the renderer in the set(gcf, 'DefaultFigureRenderer', 'painters') function, matlab still defaulted to exporting the ebsd map as an image.

Instead, I needed to set the renderer in print(gcf, 'MyEBSDMap', '-depsc', '-painters'). This exported the map as a vector object, which I can now overlay on my CL images without the white background. Not I also exported as an EPS file instead of PDF or SVG.

Let me know if you have questions about this process.