Re: y-axis direction
- To: mathgroup at smc.vnet.net
- Subject: [mg116567] Re: y-axis direction
- From: Syd Geraghty <sydgeraghty at me.com>
- Date: Sun, 20 Feb 2011 05:25:04 -0500 (EST)
Hi,
For those lucky enough to have David Park's Presentations Package:
Needs["Presentations`Master`"]
yticks = CustomTicks[-# + 50 &, {0, 50, 10, 5}];
Draw2D[{ListLineDraw[Table[{i, i^2}, {i, {1, 2, 3, 4, 5, 6}}]] /.
DrawingTransform[#1 &, -#2 + 50 &]}, AspectRatio -> 0.63,
Frame -> True,
FrameTicks -> {{yticks, yticks // NoTickLabels}, {Automatic,
Automatic}}, PlotRange -> {{0, 8}, {0, 50}},
PlotRangePadding -> {0.1, 1}, PlotLabel -> "Reverse y Axis Plot"]
The thread is from 2009 I believe:
[mg103510] How to plot with a reversed Y-axis?
Cheers .... Syd
Syd Geraghty B.Sc, M.Sc.
sydgeraghty at mac.com
Mathematica 8.0 for Mac OS X x86 (64-bit) (November 6, 2010)
MacOS X V 10.6.5 Snow Leopard
MacBook Pro 2.33 GHz Intel Core 2 Duo 2GB RAM
On Feb 18, 2011, at 1:36 AM, telefunkenvf14 wrote:
> On Feb 17, 4:18 am, "Rob Y. H. Chai" <yhc... at ucdavis.edu> wrote:
>> Hi all,
>>
>> In the Plot command, the convention for y-axis is up for positive values. Is
>> there an easy way to reverse the y-axis direction i.e. pointing down for
>> increasing positive y values? Thanks.
>>
>> Rob Chai
>
> I have encountered the same problem... economists like to graph
> inverse demand and supply equations (i.e., price(quantity)) rather
> than the true relationship of quantity(price).
>
> Possible ways around this:
>
> (1) solving for the inverse relationship and then using Plot[] (one
> could also use InverseFunction[] ---- not always straightforward as
> your function may not be clearly invertible w/o providing assumptions
> on parameters)
> (2) using ContourPlot[], which incorporates the functionality of the
> legacy function ImplicitPlot (you can still use ImplicitPlot; search
> documentation for details)
>
> For the most part, I've settled on (1).
>
> -RG
>