Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following workflow. I use matlab to produce 3D plots with transparency and I want to use the workflow of setting the text inside the figure in latex. I am using Texniccenter and MikTex the most recent versions my driver is pdflatex.

I use the matlab central funktion plot2svg to export my plot into svg. Than I use Inkscape to generate the pdf and the corresponding tex file. This generated pdf is already 3.5 MB large. I have two surfaces plotted with transparency. Maybe that's why the file is that large. My whole pdf resulting from my latex project is about the same size.

Of course if I use the includegraphics function with inside the picture environment and the the final pdf is larger than 6 MB. So if I have 10 pictures I already get a file more than 30 MB. So far so good. But if I open the file and navigate to the corresponding figure I can watch how the picture gets renderred. This takes several seconds.

Is there a way how to rreduce the file sizes maybe before including it into my document?

Thanks for your suggestions

share|improve this question
    
The workflow seems quite complex. An alternative way to may be to have a look at matlab2tikz. This depends on how complex your figures are. I have had pretty good experiences with the script. Further you can look into overpic, i.e. saving the matlab figure as pdf and including any text as objects ontop of the figure. –  Markus Feb 28 at 20:54
    
There might be a huge pile of data in that plot, too. I can't see transparency causing much of an increase in file size. If you make a transparent SVG of a plot of a simple function with a few hundred data points, does the problem persist? –  Mike Renfro Feb 28 at 21:54
    
Why don't you use inkscape2tikz and generate tikz code instead of pdf+tex files? –  Harish Kumar Feb 28 at 23:30
    
@HarishKumar : I did not try TikZ yet but I read some blog where they had more problems with tikz than with the other approaches. There is a matlab2tikz package but I don't know if this package will generate a vector graphic from matlab. Because the matlabfrag project uses the opengl renderer if transparencies are in the figure. But than one has a pixel based figure in a vector graphic. –  Nixdae Mar 2 at 10:12
    
@Markus, what do you mean with how complex the figures are. What is the downside of matlab2tikz? I have a 3d plot with two surface plots (data is 30 by 30 matrix) and a plot3 (data 15 by 15). –  Nixdae Mar 2 at 10:18

1 Answer 1

plot2svg exports the whole data in the plot, even if you zoom inside the plot plot2svg will still export the whole data of the plot and NOT just the visible graph or image. Consider as example an image matrix with 4000 x 4000 px. If you confine your displayed data by plotting only the necessary part (of interest) of your data (i.e. imshow(IMAGE(100:300, 100:300))), then only this data will be exported by plot2svg and the resulting file size of the pictures which are included in the svg-file will be smaller. Hope you find this useful!

share|improve this answer
1  
Welcome to TeX.SX! –  Adam Liter Apr 2 at 16:30
    
No I don't get what you try to say. My image is as large, as it is shown in the matlab figure how should I change a size there? It is not about showing just a part of a graph! It is about the complexity of the graph itself. –  Nixdae Apr 3 at 20:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.