MathGroup Archive 2012

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

Search the Archive

Re: Controlling scale of Graphics on paper

  • To: mathgroup at
  • Subject: [mg126186] Re: Controlling scale of Graphics on paper
  • From: Yves Klett <yves.klett at>
  • Date: Tue, 24 Apr 2012 05:31:10 -0400 (EDT)
  • Delivered-to:
  • References: <jmtd9i$sim$> <jn388q$g83$>

Addendum to my first post:

This does only work properly if the PlotRange of the graphics object is
set to reflect the values of "format" (had not used that one in a while).

So making sure your dimensions are correct by using ghostview is always
a good idea ;-)

So the right way to use this is:

gfx = Graphics[Line[{{10, 10}, {110, 10}, {110, 110}}],
  PlotRange -> {{0, 200}, {0, 200}}]

ExportScaled[filename_, gfx_, format_: {210, 297}, opts___?OptionQ] :=
  Module[{mm}, mm = 72/25.4;
   Show[gfx, ImageSize -> format*mm, ImageMargins -> 0,
    ImagePadding -> None, AspectRatio -> Automatic], opts]]

ExportScaled["test.eps", gfx, -Subtract @@@ (PlotRange /.
     Options[gfx, PlotRange])]

It is a good idea to set the PlotRange values for your graphics object
*explicitely*, because extracting the with FullOptions can result in
added whitespace (at least in some cases).


Am 23.04.2012 11:43, schrieb Yves Klett:
> ExportScaled[filename_,gfx_,format_:{210,297},opts___?OptionQ]:=Module[{mm},
> mm=72/25.4;
> Export[filename,Show[gfx,ImageSize->format*mm,ImageMargins->0,ImagePadding->None,AspectRatio->Automatic],opts]
> ]

  • Prev by Date: Constraints on guesses for Shooting Method solution to boundary value problems
  • Next by Date: Re: Serious Bug in Mathematica 7 and (latest version)
  • Previous by thread: Re: Controlling scale of Graphics on paper
  • Next by thread: Re: Controlling scale of Graphics on paper