MathGroup Archive 2007

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

Search the Archive

Re: plot question


dimitris wrote:
> Hello!
> 
> Consider the following graph of the function -ln(|x|).
> 
> Plot[-Log[Abs[x]], {x, -2, 2}, PlotRange -> {Automatic, {-1, 3.5}},
> Axes -> False, Frame -> True, PlotPoints -> 100, FrameLabel -> {"x",
> "y"}]
> 
> How is it possible to make the y-axis point downwards (I need this
> because in half-space problems within the solid mechanics the possitive
> vertical axis is pointed into the half-space)?
> 
> Thanks in advance.
> Dimitris
> 

Hi Dimitris,

You will find detail explanations from Bob Hanlon and David Park on the 
following threads "help - how to invert the x or y axis.." at 
http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/8e1dbacb8a768054/3929283d6a0dacb5?lnk=gst&q=downward+y-axis&rnum=1&hl=en#3929283d6a0dacb5

In your case, the following should work (note that I have also adjusted 
the plot range accordingly):

In[1]:=
Plot[Log[Abs[x]], {x, -2, 2},
   PlotRange -> {Automatic, {1, -3.5}},
   Axes -> False,
   Frame -> True,
   PlotPoints -> 100,
   FrameLabel -> {"x", "y"},
   FrameTicks -> {Automatic, Table[{i, -i}, {i, -4, 1}], None,
      None}];

Regards,
Jean-Marc


  • Prev by Date: Re: plot question
  • Next by Date: Difficulties with Complex-Modulus Series
  • Previous by thread: Re: plot question
  • Next by thread: Re: plot question