RE: Reverse Axes in Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg23687] RE: [mg23659] Reverse Axes in Plot
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 29 May 2000 12:24:16 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> From: David M.F. Chapman [mailto:chapmand at accesscable.net] To: mathgroup at smc.vnet.net > > Hi...I am using Mathematica 4 with the MacOS. > > I would like to plot a simple 2D plot with the y-axis increasing > DOWNwards instead of UPwards. Does anyone know how to do this? I have > looked high and low for the answer! > > cheers, Dave > Dave, Basically, you use the Ticks or FrameTicks option in your Plot or Show statement. You can use the Table command to generate the Tick options. It is a little bit of work. This seems to be a frequent question to MathGroup, so I have finally added a CustomTicks command to my DrawingPaper routines, available at my web site. With the CustomTicks command you specify how the displayed ticks are related to the original values. For example to increase in the negative direction you would use the pure function -#&. Then you specify the starting value, ending value and increment along with the number of subdivisions for the ticks. There are also separate options for specifying the number formatting, the tick specifications and the tick style. Of course, when you modify your ticks you have to make certain you are plotting the correct function to go with them. The expression x^2/10 is plotted in the negative direction by the following DrawingPaper statement. Needs["Graphics`DrawingPaper`"] Needs["Graphics`DrawingTicksAndGrids`"] Show[Graphics[{Blue, Draw[-x^2/10, {x, 0, 10}]}], PlotRange -> {{-0.01, 10}, {-10.01, 0.01}}, Background -> Linen, {Frame -> True, FrameTicks -> {Automatic, CustomTicks[-#1 & , {0, 10, 2.5, 5}], Automatic, Automatic}}]; You can also use CustomTicks in a regular Plot statement. In this case, only the DrawingTicksAndGrids package is needed. Plot[-x^2/10, {x, 0, 10}, Ticks -> {Automatic, CustomTicks[-#1 &, {0, 10, 2.5, 5}]}]; The package also has routines for drawing free standing scale lines in the x or y directions. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/