Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Non-Linear Graphics Scaling

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86475] Non-Linear Graphics Scaling
  • From: Januk <ggroup at sarj.ca>
  • Date: Wed, 12 Mar 2008 00:12:28 -0500 (EST)

Is there a way to have mathematica display a graphic using a non-
linear scaling function?  I want to scale any point on a 2D graphic by
some non-linear function of the distance away from the origin.  For a
list of points, it is trivial to force the issue:

pl3 = Graphics[{Point[
     RandomReal[{-20, 20}, {1000, 2}]
     ]
    }, Frame -> True, PlotRange -> All];
GraphicsRow@{pl3,
  pl3 /. (xy : {x_?NumericQ, y_?NumericQ} :>
     Module[{r, \[Theta]},
      r = If[Norm[xy] == 0., 0, Log[1+Norm[xy]]];
      \[Theta] = If[Norm[xy] == 0., 0, ArcTan @@ xy];
      r {Cos[\[Theta]], Sin[\[Theta]]}
      ]
    )}

Is there a way to do this for more complecated graphics (e.g. graphics
with primitives)?  For example:

pl2 = Graphics[{
   Red, Point[RandomReal[{-2,2},{100,2}]],
   Orange, Line[{{-2, .75}, {2, .75}}],
   Green, Thick , Circle[{0, 0}, 2],
   Black, Point[{0, 0}]
   }]

So far the technique of using a ReplaceAll simply transforms the end
points of the line, not the line shape.

Any thoughts of how to do this for an arbitrary Cartesian 2D graphic
would be much appreciated.

Thanks,
Januk


  • Prev by Date: Accessing and using built-in constants in Mathematica 6 / precision
  • Next by Date: Re: Convert to Expression
  • Previous by thread: Re: Accessing and using built-in constants in Mathematica 6 / precision
  • Next by thread: Re: Non-Linear Graphics Scaling