MathGroup Archive 2007

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

Search the Archive

ANN: Fixing polygon-based plots

  • To: mathgroup at
  • Subject: [mg82810] ANN: Fixing polygon-based plots
  • From: Will Robertson <wspr81 at>
  • Date: Wed, 31 Oct 2007 06:18:52 -0500 (EST)


Some have remarked recently on the poor quality of graphics produced
by ContourPlot and RegionPlot due to the fact that polygons are drawn
for every single mesh element rather than for contiguous shapes.

Announcing FixPolygons:

The solution I've implemented loops through polygons, joining them
together if they're adjacent. This allows interior holes and
discontiguous objects. The big downside is that it's slow. But not so
slow to be unusable.

The syntax is easy; something like
  RegionPlot[x^2+y^2<2,{x,-2,2},{y,-2,2}] // FixPolygons

The quality of output for exported diagrams is greatly improved and
the filesize dramatically reduced. It needs optimising and there are
edge cases that give funny results, but in general it works. Comments
and suggestions are greatly appreciated.

All the best,
Will Robertson

  • Prev by Date: Re: Vectors,Norms and assumptions
  • Next by Date: Re: vector representation
  • Previous by thread: ANN: ColorbarPlot
  • Next by thread: Simplifying polynomial and rounding problems