Since yesterday I am desperately trying to solve a Matlab-LaTex issue, which makes me crazy. This post is only for those nerds out there which dream about Matlab and LaTex instead of chocolate cakes. So here is my problem:
I have a huge datafile, which I visualize via surf in Matlab. It looks colorful, meaningful and hence worth saving as an EPS file for later changes in LaTex via the psfrag package. This works usually very smooth and creates beatiful results. Now, however, due to the huge amount of data in the Matlab image (right one below), the saved EPS file is somewhere between 20-100 MB (!!) and furthermore LaTex doesn’t open it for psfrag. The first thing I did was use a renderer like zbuffer or painters in Matlab and also skip some percentage of the data, which reduced the file size sometimes, but not always (??). I was even able to open the files in LaTex, but psfrag didn’t access the labels in those figures. And sometimes LaTex was even able to acces the labels via psfrag, but then the image had the traces of the grid I used (the white lines in the left image).
I don’t know what to try else. I could of course save the image as JPEG or PDF or whatever and then convert it to an eps figure, than, however, I can’t use psfrag to access the information saved in the images. Another way would be to use the PDF or JPEG images and use a grafic program to insert labels, which than, after saving it as an EPS file, could be accessed by Latex via psfrag. That, however, I will not do, because I have a bunch of pictures, which I wanna have as I want them and I do not compromise. Not in matters of sweets or useless littlenesses like the mentioned here. Another way would be to access the information in JPEG images via imread and than filter the labels out and plot them again via the image command, but all that is not the proper way to solve this problem. There must be a simple way to just save a figure as an EPS file and access it via psfrag in LaTex regardless the huge amount of data in the figure.
This weekend will probably be devoted to this problem and I will probably get extremely angry if some baby wants to but his needs infront of this littleness. So I had to post this in the hope of some smart nerd out there who might just have the smartest way to solve it and hence save my weekend.
PS: For those who wonder what the figure with the strange labels show: It is the Cross-spectra of the streamwise velocity and passive scalar fluctuation across a heated jet at 5 nozzle diameters downstream. The labels are of course not set, but therefore I need psfrag, because Matlab labels just don’t look good enough for my eyes.