Re: Automatic & linked axis scaling
- To: mathgroup at smc.vnet.net
- Subject: [mg64969] Re: [mg64940] Automatic & linked axis scaling
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 10 Mar 2006 05:15:00 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
It looks to me like that is exactly what Mathematica does, at least if you
use ParametricPlot3D. Look at the following. They appear to me to have
equal scaling on all axes.
ParametricPlot3D[
{x, y, Sin[x y]}, {x, -Pi, Pi}, {y, -Pi, Pi}];
ParametricPlot3D[
{x, y, 5Sin[x y]}, {x, -Pi, Pi}, {y, -Pi, Pi}];
ParametricPlot3D[
{x, y, Sin[x y]}, {x, -2Pi, 2Pi}, {y, -2Pi, 2Pi}];
If you did it in DrawGraphics where you could easily add other objects, you
also get equal scaling on all axes.
Needs["DrawGraphics`DrawingMaster`"]
Draw3DItems[
{ParametricDraw3D[
{x, y, Sin[x y]}, {x, -Pi, Pi}, {y, -Pi, Pi}]},
Axes -> True];
You have to use the BoxRatios option if you don't want equal scaling.
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
From: ggroup at sarj.ca [mailto:ggroup at sarj.ca]
To: mathgroup at smc.vnet.net
Hi,
I'm trying to find an automated way to scale the axes of graphics such that
that one unit takes up the same distance on all axes. I'm modelling
physical
objects, and often want to see various phenomenon superimposed onto that
object. It would be nice if I could avoid having the view distorted by
independent axis scaling.
On a 2D graphic, I can do this manually by specifying the AspectRatio. I
just
need to set it using the ratio of the length of the y-range to the length of
the x-range. Of course, along with that, I need to explicitly specify
corresponding values for the PlotRange.
This becomes a bit of a pain when developing a model and/or coding. Usually
the object range is well defined, but one of the other graphic objects will
have bounds that are ill-defined (say I want to add arrows indicating
calculated surface normals).
Does anyone have a good generic solution?
Thanks!