MathGroup Archive 2010

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

Search the Archive

Re: Fixing padding inside Inset

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114973] Re: Fixing padding inside Inset
  • From: JUN <noeckel at gmail.com>
  • Date: Sat, 25 Dec 2010 02:33:45 -0500 (EST)
  • References: <201012230851.DAA04731@smc.vnet.net> <if1o47$p6h$1@smc.vnet.net>

Hi,
to get exactly the same size in both outputs, you can add
SphericalRegion->True to the options in gr1 (this is advisable for 3D
graphics anyway because it makes interactive rotations work more
smoothly, at the expense of adding a little more extra space around
the object).

Jens


On Dec 24, 1:11 am, Leonid Shifrin <lsh... at gmail.com> wrote:
> Hi Yaroslav,
>
> This works for me:
>
> gr2 = Graphics[
>   Inset[gr1 /. (ImageSize -> x_) :> (ImageSize -> x*0.9)],
>   ImageSize -> 160, ImagePadding -> 0, ImageMargins -> 0,
>   PlotRangePadding -> 0]
>
> although it is not identical in size, inset image is made slightly smalle=
r.
>
> Regards,
> Leonid
>
> On Thu, Dec 23, 2010 at 11:51 AM, Yaroslav Bulatov <yarosla... at gmail.com>=
wrote:
>
>
>
>
>
>
>
> > Below I have a Graphics3D and a corresponding Graphics using Inset
> > command. The box in Inset graphics is slightly larger and is cut off.
> > I can't seem to get them to display identically, any suggestions?
>
> > shape = {Opacity[0.5],
> >   GraphicsComplex[{{-1., 0., 0.}, {0., -1., 0.}, {0., 0., -1.}, {0.,
> >      0., 1.}, {0., 1., 0.}, {1., 0.,
> >      0.}}, {{{EdgeForm[GrayLevel[0.]],
> >       GraphicsGroup[{Polygon[{{4, 5, 1}, {1, 5, 3}, {1, 3, 2}, {4=
, 1,
> >             2}, {3, 5, 6}, {5, 4, 6}, {4, 2, 6}, {2, 3,
> >            6}}]}]}, {}, {}, {}, {}}}]};
> > gr1 = Graphics3D[shape, ImageSize -> 160,
> >  PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, ImageMargins -> 0,
> >  PlotRangePadding -> 0, ImagePadding -> 0]
> > gr2 = Graphics[Inset[gr1], ImageSize -> 160, ImagePadding -> 0,
> >  ImageMargins -> 0, PlotRangePadding -> 0]



  • Prev by Date: Re: Generic Button/Palette design pattern?
  • Next by Date: Re: bibtex support in Mathematica 8
  • Previous by thread: Re: Fixing padding inside Inset
  • Next by thread: Map function with 2 variables