MathGroup Archive 1998

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

Search the Archive

Re: Reversing the axis of a plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15153] Re: Reversing the axis of a plot
  • From: "JOHN C ERB" <JOHN_C_ERB at prodigy.net>
  • Date: Wed, 16 Dec 1998 03:11:25 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Click,

Perhaps a misunderstanding.
I wish to reverse one of the axes, rather than to switch axes. For
example, the y-axis would remain the y-axis, and would range from 0 to
5, and the x-axis would remain the x-axis; however, the x-axis would
now range from 5 to 0 (with the plot reversed), as one goes from left
to right along the axis.

John C. Erb

-----Original Message-----
From: Click Work <cwork at xs4all.nl>
To: mathgroup at smc.vnet.net
Subject: [mg15153] [mg15153] Re: Reversing the axis of a plot


>Why don't you just use a ParametricPlot?
>
>>use: Plot[3x^2+5x+2,{x,0,5}];
>
>ParametricPlot[{x,3x^2+5x+2},{x,0,5}]
>
>Now reverse the axes :
>
>ParametricPlot[{3x^2+5x+2,x},{x,0,5}]
>
>
>Hope this helps you out....
>
>-----Oorspronkelijk bericht-----
>Van: John C. Erb, Ph.D. <JOHN_C_ERB at prodigy.net>
>Nieuwsgroepen: comp.soft-sys.math.mathematica
>Datum: Wednesday, December 09, 1998 10:01 AM
>Onderwerp: Reversing the axis of a plot
>
>
>>
>>Occasionally, I have would like to make a plot where one of the axes is
>>reversed; Mathematica does not seem to have this capability built in.
>>
>>Wolfram support shows how to reverse the order of ticks in a plot (see
>>www.wolfram.com/support/Graphics/Axes/Ticks/Reverse.html); however it
>>does not reverse the plot,just the ticks on the axis.
>>
>>The best workaround I've come up is given in the following example,
>>which makes use of reversing the ticks.
>>
>>I want to reverse the x-axis of the
>>plot of 3x^2+5x+2.
>>
>>To get a normal plot I could
>>use: Plot[3x^2+5x+2,{x,0,5}];
>>
>>To reverse the plot for the x-axis,
>>I would do the following.
>>---------------------------------------------------------
>>Needs["ExtendGraphics`Ticks`"];
>>
>>tickreverse[start_,finish_]:=
>>    TickFunction[start,finish,TextFunction->Reverse];
>>
>>this=Table[{x,3x^2+5x+2},{x,0,5,0.25}]; {x,y}=Transpose[this];
>>that=Transpose[{Reverse[x],y}];
>>ListPlot[that,Ticks->{tickreverse,Automatic},PlotJoined->True];
>>---------------------------------------------------------- NOTE: For
>>some reason, the above needs to be in 3 separate cells to function
>>properly. Does anyone have a more eloquent solution or any comments?
>>
>>John C. Erb
>>
>>email: John_C_Erb at prodigy.net
>>
>



  • Prev by Date: Bug with ComplexExpand on PolyGamma?
  • Next by Date: List handling
  • Previous by thread: Reversing the axis of a plot
  • Next by thread: Re: Re: Reversing the axis of a plot