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 a large plot. It is a big file and it renders slowly.

What is the best method to slim it down without loosing to much of its visual properties ?
I know that PDF and PS support cubic splines.
Is there a software that takes adventage of that and approximates true plot curve with splines?

share|improve this question
    
how did you create the plot? Through some mathematical applications? –  pluton Sep 9 '10 at 0:02
    
The question is tagged tikz, so I suppose the plot is generated by Ti k Z or PGFPlots. –  Philipp Sep 9 '10 at 9:24
    
Currently TikZ, yes. With gnuplot. But I'm looking for better solutions. –  Łukasz Lew Sep 9 '10 at 10:59
    
Plot was created from data from experiment. –  Łukasz Lew Sep 9 '10 at 11:01
    
so, you may want to treat the data with some scientific language and spline interpolation before exporting to pgf. Scilab (scilab.org/en) which is free may help. That's what I would do. –  pluton Sep 10 '10 at 1:00

3 Answers 3

If you use the pgfplot package the plot/draw command takes a [smooth] option. In most cases this provides a satisfactory solution, so that you can include less points in the plots. (If I am not mistaken it either uses splines or bezier curves for smoothing, there might even be an option.)

share|improve this answer

Inkscape does this up to an extent and Illustrator as well.

In Inkscape, you draw a path (or import it), and then you click on "path" and "simplify" (CTRL+L) and the path will be simplified. Unfortunately, there is no option, it is rather rudimentary but you may be able to export the final path in tex and use it within pgfplot.

In Illustrator, you draw a path (or import it), and then click on "Object", then "Path", then "Simplify", and play with the few options to get the best results. You can easily go from a set of thousands strait lines to very few Bézier splines.

share|improve this answer
    
Can you elaborate how can I get Inkspace to do this? –  Łukasz Lew Sep 8 '10 at 21:05
1  
you draw a path in inkscape (or import it), and then you click on "path" and "simplify" (CTRL+L) and the path will be simplified. Unfortunately, there is no option, it is rather rudimentary but you may be able to export the final path in tex and use it within pgfplot. Keep us posted on that if possible. Thank you. –  pluton Sep 9 '10 at 0:01
    
There is a plugin to export from Inkscape to TikZ directly that might be of use here. –  David Z Sep 9 '10 at 17:06
    
nice! there is no such plugin for pstricks? (just the direct tex export maybe) –  pluton Sep 9 '10 at 18:03
    
This is really a comment, not an answer to the question. Please use "add comment" to leave feedback for the author. –  Marco Daniel Aug 17 '12 at 8:15

Using Adobe Illustrator you can select the problematic curve and then use the command: Object -> Path -> Simplify... (Make sure the "straight lines" option is not checked). Play with the quality sliders to balance the number of points against the fidelity to the true curve.

I wish I knew a more flexible way to do it, because the sliders don't give you that much control...

share|improve this answer
1  
and you may not be able to import the final curve into pgf plots, unfortunately –  pluton Sep 8 '10 at 23:00

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.