MathGroup Archive 2008

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

Search the Archive

Re: export eps

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90707] Re: export eps
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sun, 20 Jul 2008 06:33:44 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <g5s9tr$557$1@smc.vnet.net>

jamesmgg at googlemail.com wrote:

> I have a graph generated with ContourPlot3D.
> 
> when I try to export it as eps, the eps file is 50MB size.
> 
> I need to use the eps image in Latex.
> 
> how to solve this problem

That all depends on what your plot actually is. Usually, when a graph is 
too large, it is a good idea to control the adaptive sampling thanks to 
the options *PlotPoints* and *MaxRecursion* (see the online help for 
more details). Below are two examples of the influence of these options 
on the size of the resulting graphs.

     Module[{g},
        Grid[Table[g = ContourPlot3D[Sin[3*x]*Sin[3*y]*Sin[3*z] == 1/2,
          {x, 0, 3}, {y, 0, 3}, {z, -1, 1}, Mesh -> None,
          BoxRatios -> Automatic, PlotPoints -> pp, MaxRecursion -> mr];
          Export["g.eps", g]; Print["Points: ", pp, ", Recursions: ", mr,
           ", File Size (MB): ", N[FileByteCount["g.eps"]/2^20]]; g,
        {pp, {5, 10}}, {mr, {0, 2}}]]]

     Points: 5, Recursions: 0, File Size (MB): 0.0848265

     Points: 5, Recursions: 2, File Size (MB): 5.90143

     Points: 10, Recursions: 0, File Size (MB): 0.201566

     Points: 10, Recursions: 2, File Size (MB): 22.4477


     Module[{g},
       Grid[Table[g = ContourPlot3D[x^4 + y^4 + z^4 - (x^2 + y^2 + z^2)^2
         + 3*(x^2 + y^2 + z^2) == 3, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
         Mesh -> None, ContourStyle -> Directive[Orange, Opacity[0.8],
         Specularity[White, 30]], PlotPoints -> pp, MaxRecursion -> mr];
         Export["g.eps", g]; Print["Points: ", pp, ", Recursions: ", mr,
           ", File Size (MB): ", N[FileByteCount["g.eps"]/2^20]]; g,
        {pp, {20, 40}}, {mr, {0, 2}}]]]

     Points: 20, Recursions: 0, File Size (MB): 1.73392

     Points: 20, Recursions: 2, File Size (MB): 4.47856

     Points: 40, Recursions: 0, File Size (MB): 7.84393

     Points: 40, Recursions: 2, File Size (MB): 19.5442


Regards,
-- Jean-Marc



  • Prev by Date: Re: export eps
  • Next by Date: Re: What does FullForm[ ] actually do?
  • Previous by thread: Re: export eps
  • Next by thread: Re: export eps