Re: Plot backwards
- To: mathgroup at smc.vnet.net
- Subject: [mg40786] Re: Plot backwards
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Thu, 17 Apr 2003 03:35:55 -0400 (EDT)
- References: <b7irc6$juh$1@smc.vnet.net>
- Reply-to: "Allan Hayes" <hay at haystack.demon.co.uk>
- Sender: owner-wri-mathgroup at wolfram.com
Gustavo,
<< Graphics`Graphics`
To get the function LinearScale.
ReverseGraphics[gr_] :=
Module[{a, b, rev, xrev, xticks},
{a, b} = PlotRange[gr][[1]];
rev[x_] = InterpolatingPolynomial[{{a, b}, {b, a}}, x];
xrev[{x_, y_}] = {rev[x], y};
xticks = xrev /@ LinearScale[a, b];
Show[gr /. {
el:_Line | _Point | _Polygon :>
Map[xrev, el, {-2}],
tx_Text :> MapAt[xrev, tx, {2}]},
Ticks -> {xticks, Automatic}]
]
Check
gr = Plot[2*x, {x, 0, 1}, Epilog ->
{{PointSize[0.1], Point[{0.2, 0.5}]},
Polygon[{{0, 1}, {0.3, 1.5}, {0.5, 1.2}}],
Text["Text", {0.1, 1.5}]}]
ReverseGraphics[gr]
--
Allan
---------------
Allan Hayes
hay at haystack.demon.co.uk
Voice: +44 (0)116 241 8747
Fax: +44 (0)870 164 0565
"Gustavo Seabra" <seabra at ksu.edu> wrote in message
news:b7irc6$juh$1 at smc.vnet.net...
> Hi,
>
> I am Using Mathematica 4.0 for Students. I'm trying to plot a
function,
> but I need the x axis to decrease to the right, instead of increasing,
like:
>
> -|----|----|----|----|
> 25 20 15 10 0
>
> I've looked everywhere I could think of. Would anyone hava suggestions?
>
> Thanks,
> Gustavo Seabra.
>
>
>