RE: Log plots: plot points *linearly* equidistant
- To: mathgroup at smc.vnet.net
- Subject: [mg31627] RE: [mg31624] Log plots: plot points *linearly* equidistant
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 19 Nov 2001 03:11:07 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Primoz,
The Log plots from Graphics`Graphics` present many difficulties in their
use. The easiest approach to making log plots is to do it yourself. However,
the LogScale Tick specification from Graphics`Graphics` is useful. The
logstep function below allows relatively even spacing of the points on a log
scale. Then you can use the regular Plot function.
Needs["Graphics`Graphics`"]
logstep[f_][y_] := f[10^(y)]
f[x_] := UnitStep[x - 1]
Plot[logstep[f][y], {y, -2, 3},
Ticks -> {LogScale, Automatic},
AxesOrigin -> {-2, 0}];
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
> From: Primoz Peterlin [mailto:primoz.peterlin at biofiz.mf.uni-lj.si]
To: mathgroup at smc.vnet.net
>
> Hello,
>
> Browsing through the archives, I have seen this question coming up
> recurringly at least since 1995, but with no satisfactory answer...
>
> The problem is that LogLinearPlot and LogLogPlot functions evaluate plot
> points at values which are *linearly* equidistant on the x-axis, not
> logarithmically. Why this is erroneous can be seen on a simple example:
>
> Needs["Graphics`Graphics`"]
> LogLinearPlot[UnitStep[x - 1], {x, 0.01, 1000}]
>
> As far as I know, there are two ways of avoiding this behaviour:
>
> a) setting PlotDivision option to higher, often prohibitively high
> values,
>
> b) evaluating one's own list of {x,} pairs and using LogLinearListPlot
> or LogLog
> ListPlot to plot it
>
> The first solution is slow and inefficient, the second one is
> cumbersome. Has nobody so far been annoyed by the LogLinearPlot
> behaviour enough to actually rewrite it in a decent way? :)
>
> With kind regards,
> Primoz
>
> --
> Primo¾ Peterlin, In¹titut za biofiziko, Med. fakulteta, Univerza v
> Ljubljani
> Lipièeva 2, SI-1000 Ljubljana, Slovenija.
> primoz.peterlin at biofiz.mf.uni-lj.si
> Tel: +386-1-5437632, fax: +386-1-4315127,
> http://sizif.mf.uni-lj.si/~peterlin/
>