Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: Re: datelistplot - log axis for values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82891] Re: [mg82825] Re: [mg82806] datelistplot - log axis for values
  • From: "Thomas Dowling" <thomasgdowling at gmail.com>
  • Date: Fri, 2 Nov 2007 03:34:15 -0500 (EST)
  • References: <200710311116.GAA22567@smc.vnet.net>

Does this work?

Tom Dowling

On 11/1/07, Carl Woll <carlw at wolfram.com> wrote:
>
> sdw wrote:
>
> >Hi -
> >
> >Does anyone have a clever way to make datelistplot act like loglistplot
> and create nice log Y axis vs. dates?
> >
> >this is not the same as just logging the y variable before plotting - I
> want the Y axis to show the actual values on a log scale, not the log values
> on a linear scale
> >
> >thanks,
> >
> >Steven
> >
> >
> >
> >
> One way is to use the internal function used by LogPlot and friends.
> First, make Mathematica load the .mx file necessary for LogPlot
> functionality:
>
> In[1]:= LogPlot
>
> Out[1]= LogPlot
>
> Next, let's make some data:
>
> data = CountryData["US", {"GDP", All}];
>
> We need to scale the data:
>
> scaledata = data;
> scaledata[[All, -1]] = Log[scaledata[[All, -1]]];
>
> Now, we use the internal function Graphics`LogPlotDump`LogScale (this is
> why we executed In[1], as this function would be undefined if we hadn't):
>
> ticks = Graphics`LogPlotDump`LogScale[Min[scaledata[[All, -1]]],
> Max[scaledata[[All, -1]]]];
>
> Finally, you are ready to make the DateListPlot:
>
> DateListPlot[scaledata,  FrameTicks -> {Automatic, ticks, True, None}]
>
> <plot snipped>
>
> Carl Woll
> Wolfram Research
>
>



  • Prev by Date: Re: NDSolve with functions of vectors
  • Next by Date: Re: "Accumulate" in Mathematica 6
  • Previous by thread: Re: datelistplot - log axis for values
  • Next by thread: Re: library.wolfram submissions