Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2991 > unrolled thread

Using Fit[] inside Plot[] function

Started bytwiggy666 <dejanristic78@gmail.com>
First post2011-06-07 10:47 +0000
Last post2011-06-08 11:14 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Using Fit[] inside Plot[] function twiggy666 <dejanristic78@gmail.com> - 2011-06-07 10:47 +0000
    Re: Using Fit[] inside Plot[] function Thomas <thomas.a.lanz@gmail.com> - 2011-06-08 11:14 +0000

#2991 — Using Fit[] inside Plot[] function

Fromtwiggy666 <dejanristic78@gmail.com>
Date2011-06-07 10:47 +0000
SubjectUsing Fit[] inside Plot[] function
Message-ID<iskvj7$5pp$1@smc.vnet.net>
pt = {{3, a}, {5, b}, {9, c}, {11, d}, {15, e}, {18, f}}
Plot[Fit[pt, {0, x, x^2, x^3, x^4, x^5, x^6}, x], {x, 0, 18}]

I want to use this type of plot inside a dynamic module (see link to notebook below for full code).
Doesnt work though.
 I know i can use InterpolatingPolynomial[] inside Plot[] for similar effect but it doesnt produce the same curve.

This is a link to a notebook with the full code:
http://dl.dropbox.com/u/28494067/upg3.nb

[toc] | [next] | [standalone]


#3020

FromThomas <thomas.a.lanz@gmail.com>
Date2011-06-08 11:14 +0000
Message-ID<isnlja$n52$1@smc.vnet.net>
In reply to#2991
On Jun 7, 7:47 pm, twiggy666 <dejanristi...@gmail.com> wrote:
> pt = {{3, a}, {5, b}, {9, c}, {11, d}, {15, e}, {18, f}}
> Plot[Fit[pt, {0, x, x^2, x^3, x^4, x^5, x^6}, x], {x, 0, 18}]
>
> I want to use this type of plot inside a dynamic module (see link to notebook below for full code).
> Doesnt work though.
>  I know i can use InterpolatingPolynomial[] inside Plot[] for similar effect but it doesnt produce the same curve.
>
> This is a link to a notebook with the full code:http://dl.dropbox.com/u/28494067/upg3.nb

If you work with a different argument name in the Plot it works:

DynamicModule[
 {pt = {{3, 7}, {5, 8}, {9, 1}, {11, 1}, {15, 3}, {18, 0}}},
 LocatorPane[
  Dynamic[pt],
  Dynamic[
   Show[
    Plot[Fit[pt, {0, x, x^2, x^3, x^4, x^5, x^6}, x] /. x -> y, {y, 0,
       18}, PlotStyle -> Brown, PlotRange -> {{0, 18}, {10, -1}}]
    ]
   ]
  ]
 ]

hope this helps.
Regards,
T

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web