MathGroup Archive 2011

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

Search the Archive

Re: AspectRatio unpredictable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121456] Re: AspectRatio unpredictable
  • From: Christopher Young <cy56 at comcast.net>
  • Date: Fri, 16 Sep 2011 05:45:48 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201109140912.FAA15860@smc.vnet.net> <D7D33E27-520B-4207-AD05-C044A3C7D008@gmail.com>

Thanks very much. It looks like BoxRatios is what I was after.
Together with SphericalRegion -> True, this makes the bounding box keep 
the same shape, which is what I was after. I think I should not set 
AspectRatio, because when I'm turning the cube, the two-dimensional 
bounding box may have to change size to accommodate the rotating cubic 
bounding box.

A lot of details to work out, but the two things, BoxRatios set at 1, 
and SphericalRegion set to true seem to guarantee the kind of stability 
I was looking for when rotating the graphic.

Chris


saddleStepPlot2[es_] :=
  DiscretePlot3D[
   x * y,
  
   {x, -2, 2},
   {y, -2, 2},
  
   PlotRange -> {{-4, 4}, {-4, 4}, {-4, 4}},
   BoxRatios -> {1, 1, 1},
   SphericalRegion -> True,
  
   ExtentSize -> es,
   AxesOrigin -> {0, 0, 0},
   AxesLabel -> {"x", "y", "z"},
   PlotStyle -> Opacity[0.5],
   ColorFunctionScaling -> False,
   ColorFunction -> (Hue[0.35 (#3 + 4)/8 ] &)
   ];
On Sep 14, 2011, at 5:46 AM, Heike Gramberg wrote:

> n my version of Mathematica (8.0.1 for OS X) the boxes stay the same 
shape when I rotate the graphs in your examples, but you could try 
setting BoxRatios->{1,1,1} if you want the bounding box to be a cube. To 
keep the size of the graph the same when rotating it you could try 
setting SphericalRegion->True.
>
> Heike


On Sep 14, 2011, at 8:03 AM, David Park wrote:

> If you had Presentations you could have used the NiceRotation option set.
> This is actually equivalent to:
>
> Sequence[SphericalRegion -> True, RotationAction -> "Clip"]
>
> Or, after you produce your plot, zoom first (Ctrl and move mouse) and then
> rotate.


On Sep 14, 2011, at 4:19 PM, John Fultz wrote:

> What do you mean that the bounding box is "cube-shaped"?  AspectRatio controls
> the two-dimensional bounding box, in your case, making it as *square* as
> possible.  There are also three-dimensional factors coming into play, such as
> BoxRatios, which determine how much of that 2D area can actually be usefully
> filled with an image.
>
> You might better benefit by sticking to adjusting the 3D parameters...in this
> case, I think BoxRatios and SphericalRegion are options you would find useful.
> I can only speculate, but perhaps something like this is what you were hoping
> for:
>
> DiscretePlot3D[x*y, {x, -2, 2}, {y, -2, 2},
> PlotRange -> {{-4, 4}, {-4, 4}, {-4, 4}}, SphericalRegion -> True,
> BoxRatios -> {1, 1, 1}, ExtentSize -> 0.75,
> AxesLabel -> {"x", "y", "z"}, PlotStyle -> Opacity[0.5],
> ColorFunctionScaling -> False,
> ColorFunction -> (Hue[0.35 (#3 + 4)/8] &)]

> On Wed, 14 Sep 2011 05:12:08 -0400 (EDT), Christopher O. Young wrote:
>> When I rotate this plot, the size and shape of the bounding box jumps
>> around pretty wildly. It goes from cube-shaped, the way it should be, to a
>> flattened box.
>>
>> There are pictures at http://home.comcast.net/~cy56/AspectRatio%20OK.pdf
>> and http://home.comcast.net/~cy56/AspectRatio%20bug.png
>>
>> DiscretePlot3D[
>> x * y,
>>
>> {x, -2, 2},
>> {y, -2, 2},
>>
>> PlotRange -> {{-4, 4}, {-4, 4}, {-4, 4}},
>> AspectRatio -> 1,
>>
>> ExtentSize -> 0.75,
>>
>> AxesLabel -> {"x", "y", "z"},
>> PlotStyle -> Opacity[0.5],
>> ColorFunctionScaling -> False,
>> ColorFunction -> (Hue[0.35 (#3 + 4)/8 ] &)
>> ]
>>
>> Here's a simpler example (which I should have done first):
>>
>> Plot3D[
>> x y,
>>
>> {x, -2, 2},
>> {y, -2, 2},
>>
>> AspectRatio -> 1
>> ]
>>
>> Again, the bounding box starts off the wrong shape (not as tall as it is
>> wide) and when you try to rotate it, the shape and size jump around
>> unpredictably. It's only a cube, the way it should be, about half the time
>> you're rotating it.
>>
>> Chris Young
>> cy56 at comcast.net



  • Prev by Date: Re: Compilation: Avoiding inlining
  • Next by Date: Interactive settings for ParamPlot3D. Mesh not quite working.
  • Previous by thread: Re: AspectRatio unpredictable
  • Next by thread: Re: AspectRatio unpredictable