Re: a workaround for large EPS files from ContourPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg87408] Re: a workaround for large EPS files from ContourPlot
- From: Antti Penttilä@smc.vnet.net
- Date: Thu, 10 Apr 2008 02:10:07 -0400 (EDT)
- Organization: University of Helsinki
- References: <fti3ub$ogo$1@smc.vnet.net>
Michele, The package by Will Robertson at http://library.wolfram.com/infocenter/MathSource/7029/ does something similar. Maybe you could test if your or his implemention is faster or more reliable and inform us, since the EPS bug is quite annoying when producing figures for presentations or publications. Regards, Antti mikelito at gmail.com wrote: > As others have noticed in previous posts, if one exports an EPS from a > ContourPlot produced by Mathematica6, the result is far from being > satisfactory. The EPS is one order of magnitude larger in size than > the one generated by Math5 in similar situations, and displays ugly > artefacts when viewed on screen. > > The problem comes from the fact that the plot is generated internally > by a recursive method, producing a dense mesh of triangles even where > the function is flat and there is a large monochromatic surface. > > I think this approach is incredibly inefficient, and I hope that > future versions will fix this issue. In the meantime I came up with a > package to heal the problem. Basically, the triangles are iteratively > collapsed forming larger polygons and deleting useless segments. > > The function is rather slow, as a lot of complex pattern substitutions > must be performed. If someone is able to make it faster, it would be > great. However, it works. I experienced savings in EPS size from a > factor of 5 up to 50, depending on the complexity of the initial > plot. > > If you need an EPS of reasonable size, this is a viable workaround. I > hope someone will benefit of this. > > Michele Ceriotti