Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Newbie Plot-Fit Questions.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31137] Re: [mg31116] Newbie Plot-Fit Questions.
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 12 Oct 2001 03:36:58 -0400 (EDT)
  • References: <200110102314.TAA25712@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

It looks weird, doesn't it? The thing is, if you ask for the attributes of
Plot you'll find that one of them is HoldAll, which specifies that all
arguments to Plot are to be maintained in an unevaluated form. You must then
force the argument (in this case, Fit[etc].) to be evaluated before it is
sent to Plot. Try

Plot[(Evaluate[

Fit[{{2942,3650782},{2955,2255796},{3204,730421},{4105,1740135},{7815,
              6329111},{13097,7116844}},{1,x,x^2,x^3},x]]),{x,2942,13097}]]

and the mystery will vanish. A useful discussion on the subject can be found
in The Book, Section 1.9.1.

Tomas Garza
Mexico City

----- Original Message -----
From: "SkyBeaux" <realbeaux at yahoo.com>
To: mathgroup at smc.vnet.net
Subject: [mg31137] [mg31116] Newbie Plot-Fit Questions.


> Please explain this to me:
>
> If I do the following:
>
> Fit[{{2942, 3650782}, {2955, 2255796}, {3204, 730421}, {4105,
> 1740135}, {7815,
>        6329111}, {13097, 7116844}}, {1, x, x^2, x^3}, x]
>
> Results are:
> \!\(1.7044496230729986`*^7 - 8507.38287339198`\ x +
>     1.3901134594316935`\ x\^2 - 0.00006096360495406324`\ x\^3\)
>
> Then I plot the results as follows:
>
> \!\(Plot[1.7044496230729986`*^7 - 8507.38287339198`\ x +
>       1.3901134594316935`\ x\^2 - 0.00006096360495406324`\ x\^3, {x,
> 2942,
>       13097}]\)
>
> I get a nice "sin" looking plot.  (This is what I want.)
>
> However if I try to combine the two statements into one.  Like this:
>
> Plot[(Fit[{{2942, 3650782}, {2955, 2255796}, {3204, 730421}, {4105,
>           1740135}, {7815, 6329111}, {13097, 7116844}}, {1, x, x^2,
> x^3},
>       x]), {x, 2942, 13097}]
>
> I get a linear chart.
>
> What is the difference?  And how do I get my nice "sin" looking plot
> back?
>
> As you can see, I an not really sure what is being plotted by the
> first set of commands, but I think it is a log plot.
>
> Thanks for you help.
>
> --SB
>



  • Prev by Date: Date and Time in Headers (odd quirk)
  • Next by Date: Re: Can Fit give function coefficients?
  • Previous by thread: Newbie Plot-Fit Questions.
  • Next by thread: Re: Newbie Plot-Fit Questions.