Re: Plot, Cursor and Spelling Errors questions
- To: mathgroup at smc.vnet.net
- Subject: [mg14434] Re: [mg14393] Plot, Cursor and Spelling Errors questions
- From: "Jens-Peer Kuska" <kuska at linmpi.mpg.de>
- Date: Wed, 21 Oct 1998 03:32:30 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi Ranko, the answers are simple 1) Mathematica can't draw the difference because You typed P[x] (CapitalP) but you have only defined p[x_] (small p) change Your last line to Plot[Evaluate[f[x]-p[x]], {x,-1, 1}, PlotPoints -> 50]; and all works fine. 2) Put the commands Off[General::spell] Off[General::spell1] at the top of Your notebook and You will never see the messages again. Hope that helps Jens -----Original Message----- From: Ranko Bojanic <bojanic at math.ohio-state.edu> To: mathgroup at smc.vnet.net Subject: [mg14434] [mg14393] Plot, Cursor and Spelling Errors questions >Dear Mathematica friends: > >I am having problems when trying to plot the graph of an error curve >when the magnitude of the error curve is close to the $MachineEpsilon >number. The following example is typical: > >n = 15; >f[x_] := Exp[x]; >xLst = Table[Cos[((2*k - 1)*Pi)/(2*n)], {k, 1, n}]//Reverse; yLst = >N[Map[f,xLst], 30]; >fLst = Transpose[{xLst, yLst}]; >p[x_] := InterpolatingPolynomial[fLst, x]; Plot[Evaluate[f[x]-P[x]], {x, >-1, 1}, PlotPoints -> 50]; > >Why the Plot function cannot draw the graph of the difference? I can >still get a graph by computing 1000 points on the error curve and using >ListPlot with PlotJoined->True, but the graph is not very smooth. > >The problem here is not in the accuracy of computations, as the ListPlot >function shows, but in the way Plot processes data. Is there a way to >force Plot to draw the error curve correctly? > >An unrelated programming question:While Mathematica is doing a lengthy >computation, I would like to change the cursor into a watch cursor. I >could not find any information on how to do it. Is there a simple >command to change the current cursor into a watch cursor - something >like SetCursor and InitCursor in Pascal. > >Last question: If you run the program listed here, you will probably get >the messages : >General::spell:Possible spelling error: new symbol "yLst" is similar > to existing symbol {xLst} General::spell:Possible >spelling error: new symbol "fLst" is similar > to existing symbol {xLst,yLst} > Is there a way to turn off these spelling errors messages? > >Thanks, >Ranko Bojanic >bojanic at math.ohio-state.edu > > >