MathGroup Archive 2000

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

Search the Archive

LogLinear/LogLogPlot Point Sampling

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25349] LogLinear/LogLogPlot Point Sampling
  • From: Anthony Foglia <afoglia at sal.physics.ucsb.edu>
  • Date: Sat, 23 Sep 2000 03:36:21 -0400 (EDT)
  • Organization: University of California, Santa Barbara
  • Sender: owner-wri-mathgroup at wolfram.com

I seem to have come across a slight bug/problem in the way Mathematica
draws LogLog and LogLinear plots.  In particular, it samples the plotted
function as if it were a normal linearlinear plot and then scales the
results.  This leads to oversampling on the right side of the plot, and
undersampling on the left.

For example:

Plot[UnitStep[x - 1], {x, 0, 10}];

returns the correct plot, but 

LogLinearPlot[UnitStep[x - 1], {x, 0.01, 10}];

has a slight slope instead of a sharp discontinuity at x=1.  We can worsen
the plot by changing the scale

LogLinearPlot[UnitStep[x - 1], {x, 0.01, 1000}];

looks even worse, starting out linearly increasing from .01 to 1.

This problem is obviously caused by the sampled points, as increasing the
PlotPoints option improves the plots.

But, short of that (some of my plots take a long time for each point to be
calculated), has anyone come up with a fix to the LogLinearPlot and
LogLogPlot functions to sample the range logarithmically.  (Looking through
the Graphics`Graphics` library, it seems to involve the ScaledPlot
function, but I'm very new to Mathematica programming and quickly find
myself lost trying to understand it.)

Thank you.

--Anthony


  • Prev by Date: Re: Point inside a plygon? and PointInsidePolyhedronQ
  • Next by Date: filtering data
  • Previous by thread: Re: Point inside a plygon? and PointInsidePolyhedronQ
  • Next by thread: filtering data