Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

datelistplot - log axis for values

40 views
Skip to first unread message

sdw

unread,
Oct 31, 2007, 7:30:55 AM10/31/07
to
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

Carl Woll

unread,
Nov 1, 2007, 6:06:20 AM11/1/07
to
sdw wrote:

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

Mark Fisher

unread,
Nov 1, 2007, 6:44:11 AM11/1/07
to

I don't have code to do this (I may have to write something), but I
wish this functionality were built in. (Are you listening Darren?)

--Mark


Thomas Dowling

unread,
Nov 2, 2007, 4:43:42 AM11/2/07
to
Does this work?

Tom Dowling

On 11/1/07, Carl Woll <ca...@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
> >
> >
> >
> >

0 new messages