Re: plot question
- To: mathgroup at smc.vnet.net
- Subject: [mg72699] Re: plot question
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 16 Jan 2007 02:11:10 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <eofj7u$hdb$1@smc.vnet.net>
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