MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: a workaround for large EPS files from ContourPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87420] Re: a workaround for large EPS files from ContourPlot
  • From: Will Robertson <wspr81 at gmail.com>
  • Date: Thu, 10 Apr 2008 02:12:23 -0400 (EDT)
  • References: <fti3ub$ogo$1@smc.vnet.net>

Hi Michele,

On Apr 9, 6:57 pm, "mikel... at gmail.com" <mikel... at gmail.com> wrote:
> If you need an EPS of reasonable size, this is a viable workaround. I
> hope someone will benefit of this.

I'm glad I'm not the only one that writes seemingly inscrutable
Mathematica code :) I just read over my original code and it doesn't
make much sense even to me.

I've taken a closer look at your package, although I haven't yet
tested against the edge cases that fail with my own FixPolygons
function.

I really love the debug output you do. Gives a much better user
interface for cases that take a long time.

After removing the StatusBar` dependence in ClearCP, I get a warning
when the package is loaded but it seems to work fine. Here are the
numbers on my 2.2GHz Core 2 Duo comparing your function to mine:

SetDirectory@NotebookDirectory[]
<< "FixPolygons`"
<< "ClearCP`"
g = ContourPlot[a^2 + b^2, {a, -10, 10}, {b, -5, 5}];
Export["polygons.pdf", g];
Show[Import["polygons.pdf"]]
g2 = FixPolygons@ContourPlot[
  x^2 + y^2, {x, -2, 2}, {y, -1, 1}] // Timing
g3 = ClearCP[ContourPlot[
  x^2 + y^2, {x, -2, 2}, {y, -1, 1}],
   Debug -> False] // Timing

My function takes 15.8606s
Yours takes 106.889s

Obviously this is totally dependent on the contour plot originally
chosen. In my opinion, both are too slow! If it's any consolation, my
original code was orders of magnitude slower than yours :) It required
a complete re-write to get it useable. (Pattern matching those HUGE
lists of co=F6rdinates was the problem.)

I'd be interested to hear from others who may have looked at similar
things. I hope we can work together to improve our respective
packages. Who knows; if we do a good enough job, we may have solved
Wolfram's own problem for them and they can just stick our code inside
ContourPlot :)  (The licence of my package was specifically chosen to
allow this rather unlikely outcome.)

Best regards,
Will


  • Prev by Date: Re: Trace'ing Gradient in FindMinimum
  • Next by Date: Re: a workaround for large EPS files from ContourPlot
  • Previous by thread: Re: a workaround for large EPS files from ContourPlot
  • Next by thread: Re: a workaround for large EPS files from ContourPlot