MathGroup Archive 2006

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

Search the Archive

Reverse axis for LogLogListPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67943] Reverse axis for LogLogListPlot
  • From: "kevin_jazz" <kevinbowman at mac.com>
  • Date: Thu, 13 Jul 2006 06:54:19 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I found a discussion back in 2000 for reverse the axis of a Plot.  In
that discussion, Bob Hanlon provided the following code (I'm a bit new,
so I still don't quite understand it):

reversedListPlot[expr_,
    {REVx_?(Element[#, Booleans] &),
      REVy_?(Element[#, Booleans] &)},
    opts___] :=
  Module[{plt =
        ListPlot[expr, opts, DisplayFunction -> Identity]},
     Show[{
        plt /.
          {x_?NumericQ, y_?NumericQ} :> {If[REVx, -x, x], If[REVy, -y,
y]}},
      Ticks ->  {
          If[REVx, (Ticks  /. AbsoluteOptions[plt, Ticks])[[1]] /.
              {x_, label_, len_, style_} :> {-x, label, len, style},
            Automatic],
          If[REVy, (Ticks  /. AbsoluteOptions[plt, Ticks])[[2]] /.
              {y_, label_, len_, style_} :> {-y, label, len, style},
            Automatic]
          },
      DisplayFunction -> $DisplayFunction]]

This has worked quite well for standard plottting.  However, I need to
reverse the axis for a LogLog plot.

In particular I'm trying to plot terrestrial ozone as a function of
pressure.  It is common practice to plot the highest level, e.g. 1000
hPa, at the bottom of the plot.  The pressure scale is best plotted in
log and ozone, which can vary by several orders of magnitude, is also
plotted in Log.  I tried creating the same plot for LogLogListPlot (I
simply changed ListPlot to LogLogListPlot), but I get garbage.

Does have any insight on how to reverse the axis properly either using
Bob Hanlon's approach or their own code? 

Thanks,

Kevin Bowman
JPL


  • Prev by Date: principal value
  • Next by Date: Re: Re: 3D plot of globe (map of world)?
  • Previous by thread: Re: principal value
  • Next by thread: Re: matrix substitution