MathGroup Archive 2000

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

Search the Archive

Re: Question: PlotPoints in LogLinPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22736] Re: [mg22694] Question: PlotPoints in LogLinPlot
  • From: Hartmut Wolf <hwolf at debis.com>
  • Date: Fri, 24 Mar 2000 03:27:23 -0500 (EST)
  • Organization: debis Systemhaus
  • References: <200003220528.AAA09227@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Ronald Sastrawan schrieb:
> 
> I am using LogLinearPlot to graph a function between 0.01 and 10000. To
> obtain a smooth curve especially in the domain between 0.01 and 0.1, I
> need a vast number of PlotPoints, which takes a long time. Is there a
> way to tell Mathematica to choose a logarithmic distribution for the
> PlotPloints?
> 

Ronald,

indeed this is a week point of that package ... however, you may
tabulate the function values at logarithmically spaced sampling points
by your own:

<< Graphics`Graphics`

fun[x_] := Sin[Pi Log[x]]

Length[data = Table[With[{x = N[10^i]}, {x, fun[x]}], {i, -1, 4, 0.02}]]

LogLinearListPlot[data, PlotJoined -> True]

This is not quite satisfying, since there is no adaptive sampling.

A next best method would be to plot the function over smaller intervals,
keep the function values and combine:

plots = With[{step = 0.75}, 
   Plot[fun[x], {x, #1, Min[ #2, 10^4]}, DisplayFunction -> Identity] &
@@@ 
      Partition[10^Range[-1, 4 + step, step], 2, 1]]

Length[data2 = Join @@ Map[Part[#, 1, 1, 1, 1] &, plots]]

LogLinearListPlot[data2, PlotJoined -> True, 
  PlotRange -> {{10^-1, 10^4}, Automatic}]


Hartmut


  • Prev by Date: Re: Question: PlotPoints in LogLinPlot
  • Next by Date: Re: pattern in list of derivatives
  • Previous by thread: Question: PlotPoints in LogLinPlot
  • Next by thread: Re: Question: PlotPoints in LogLinPlot