Re: Plot[x Sin[x],{-100,100}] Bad {-100,99} Good?
- To: mathgroup at smc.vnet.net
- Subject: [mg38318] Re: Plot[x Sin[x],{-100,100}] Bad {-100,99} Good?
- From: "Steve Luttrell" <luttrell at _removemefirst_westmal.demon.co.uk>
- Date: Thu, 12 Dec 2002 01:33:08 -0500 (EST)
- References: <at4d54$etu$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
A similar problem occurs with Mathematica 4.2 for Windows, but the range
over which it occurs is somewhere in the range x=30 to x=40 (I haven't
checked precisely). You can fix the problem by using a larger number of
PlotPoints, which ensures that the oscillating function you want to plot
doesn't fool the plotting algorithm. In this case the following works:
Plot[x Sin[x], {x, -100, 100}, PlotPoints -> 100];
Steve Luttrell
"Steven T. Hatton" <hattons at globalsymmetry.com> wrote in message
news:at4d54$etu$1 at smc.vnet.net...
> This is Mathematica 4.2 on Linux. I evaluated Plot[x Sin[x], {-100,100}]
and
> disvovered that the portion of the plot between,9.5Pi and 11Pi is
displayed
> as a line segment joining the points {9.5 , 9.5 Sin[9.5]} and {11 , 11
> Sin[11]}. I've also found that the plot from x=-100 to x=99.99 is
incorrect.
> The plot over the range [-100,99] is correct. What is happening here?
Does
> this happen on other systems?
> --
> STH
> Hatton's Law:
> "There is only One inviolable Law."
>
>