Re: Weird Plot problem
- To: mathgroup at smc.vnet.net
- Subject: [mg59782] Re: Weird Plot problem
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 21 Aug 2005 03:51:30 -0400 (EDT)
- References: <de6lqh$cfq$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Owen, HL (Hywel) schrieb: > Hi folks, > > I'm seeing a weird plot problem. For reference, I'm using Mathematica 5.2 on Windows XP. > > First, using the package > > << Statistics`ContinuousDistributions` > > I define a Gaussian function modulated with a Sin[] as: > > ModulatedGaussian[x_, =EC_, =F3_, modamp_, mod=EB_] := PDF[NormalDistribution[=EC, =F3],x](1 + modamp Sin[2 =F0 x/mod=EB]) > > I then Plot it using: > > Plot[ModulatedGaussian[x, 0.0, 1.0, 0.3, 0.2], {x, -5, 5}] > > Instead of seeing the modulation properly, I see the plot available at: > http://www.astec.ac.uk/staff/owen/pictures/graph.png > > Plot[ModulatedGaussian[x, 0.0, 1.0, 0.31, 0.2], {x, -5, 5}] > and Plot[ModulatedGaussian[x, 0.0, 1.0, 0.29, 0.2], {x, -5, 5}] > (changing the modulation amplitude) both work fine. Generating the data also works: > > ListPlot[Table[{x,ModulatedGaussian[x, 0, 1, 0.3, 0.2]}, {x, -5, 5, 0.01}], PlotJoined -> True] > > Anyone else get the same behaviour? Is it a bug? > > Cheers, > > Hywel > > ------------------------------------------- > Hywel Owen h.owen at dl.ac.uk > Accelerator Science and Technology Centre > CCLRC Daresbury Laboratory > United Kingdom > Tel/Fax: +44 1925 603797/603192 > ------------------------------------------- > "Errors using inadequate data are much less than those using no data at all." > -- Charles Babbage > Hello, in this case, Mathematica does not evaluate a sufficient number of points. Add the option PlotPoints->100 to your call to Plot[]. (avoid PlotPoints->27 :-) ). Peter -- Peter Pein Berlin http://people.freenet.de/Peter_Berlin/