MathGroup Archive 2007

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

Search the Archive

Re: Flat colour in RegionPlot; millions of little triangles

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81639] Re: Flat colour in RegionPlot; millions of little triangles
  • From: c <flutzpah at gmail.com>
  • Date: Sun, 30 Sep 2007 03:58:54 -0400 (EDT)
  • References: <fdkqst$7bk$1@smc.vnet.net><fdl9sh$dab$1@smc.vnet.net>

This is a great hack, and it works on things like Plot3D (of course).
However, I can't get it to work if one uses the option Mesh -> All in
the original generating expression (everything except the intersection
of the surface with the bounding frame is wiped out) . What am I doing
wrong?




On Sep 29, 4:37 am, "Steve Luttrell"
<steve at _removemefirst_luttrell.org.uk> wrote:
> You can use Mathematica to automatically delete all of the polygons used to
> simulate the fill.
>
> This creates the raw graphic.
>
> g = RegionPlot[
>   Abs[Nest[(#^2 + x + I y) &, x + I y, 16]] < 2, {x, -2, 1}, {y, -1.5,
>     1.5}]
>
> This filters the graphic to remove all of the polygons.
>
> g2 = g /. {Polygon[__] -> {}}
>
> If you want to look at the expression that Mathematica uses to represent a
> graphic (or anything else) then wrap it in FullForm. Thus FullForm[g] will
> show the expression with all of the polygons present, and FullForm[g2] will
> show the filtered version of the expression without polygons.
>
> --
> Steve Luttrell
> West Malvern, UK
>
> "Will Robertson" <wsp... at gmail.com> wrote in message
>
> news:fdkqst$7bk$1 at smc.vnet.net...
>
> > Hello,
>
> > I'm creating a bunch RegionPlot figures at the moment and I'm a little
> > concerned by the algorithm Mathematica uses to save the figure.
> > Consider something like this, adapted from the RegionPlot help:
>
> > RegionPlot[
> > Abs[Nest[(#^2 + x + I y) &, x + I y, 16]] < 2, {x, -2, 1}, {y, -1.5,
> > 1.5}]
> > Export["region-plot.svg", %];
>
> > (I've chosen SVG just so I can open the image in Inkscape. The effect
> > is visible in EPS and PDF images as well.)
>
> > The resulting image is a funny shape that consists of millions (I
> > exaggerate) of polygons that fill the region, obviously corresponding
> > to the mesh used in Mathematica to create the region. However, it also
> > creates a grey outline that is a *single* graphic object that is
> > otherwise transparent.
>
> > In Inkscape, I can delete *all* of the polygons and apply a fill
> > colour to the single graphic object that defines the outline. This
> > reduces the complexity and file size of the image by orders of
> > magnitude with the same (or better!) output quality.
>
> > Is there a way to replicate this process within Mathematica itself
> > before I output to PDF? I am loath to perform this task manually in
> > Inkscape every time I generate an image.
>
> > Many thanks,
> > Will Robertson




  • Prev by Date: Re: Re: Version 6 won't import Excel (Mac)
  • Next by Date: Problem with lists as matrices for OLS and statistical inference
  • Previous by thread: Re: Flat colour in RegionPlot; millions of little triangles
  • Next by thread: Rotate a 2D graph