MathGroup Archive 2010

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

Search the Archive

Re: DiscretePlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110413] Re: DiscretePlot
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 17 Jun 2010 02:03:14 -0400 (EDT)

On my system, these all work fine without any error messages.

$Version

7.0 for Mac OS X x86 (64-bit) (February 19, 2009)

fff = Compile[{x}, x^2];

DiscretePlot[fff[x], {x, 1, 10, 0.1},
 Joined -> True]

DiscretePlot[{fff[x]}, {x, 1, 10, 0.1},
 Joined -> True]

ListLinePlot[
 {Table[fff[x], {x, 1, 10, 0.1}]},
 Joined -> True, Filling -> Bottom]

ListLinePlot[
 fff /@ Range[1, 10, 0.1],
 Joined -> True, Filling -> Bottom]

However, this works but gives an error message

ListLinePlot[
 fff[Range[1, 10, 0.1]],
 Joined -> True, Filling -> Bottom]


Bob Hanlon

---- Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote: 

=============
I am somewhat puzzled by the following behaviour of DiscretePlot

fff = Compile[{x}, x^2];

This works fine:

DiscretePlot[fff[x], {x, 1, 10, 0.1}, Joined -> True]

This also works, but produces an error message:

DiscretePlot[{fff[x]},{x,1,10,0.1},Joined->True]
CompiledFunction::cfsa: Argument x at position 1 should be a machine-size real number. >>

This becomes a (slight) problem when plotting several functions. Using ListLinePlot avoids it:

ListLinePlot[{Table[fff[x], {x, 1, 10, 0.1}]}, Joined -> True,
 Filling -> Bottom]

Andrzej Kozlowski=




  • Prev by Date: Java heap space on Mac OS X not supported?
  • Next by Date: Re: Normal with GeometricTransformation
  • Previous by thread: Re: DiscretePlot
  • Next by thread: Re: DiscretePlot