Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3020
| From | Thomas <thomas.a.lanz@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Using Fit[] inside Plot[] function |
| Date | 2011-06-08 11:14 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <isnlja$n52$1@smc.vnet.net> (permalink) |
| References | <iskvj7$5pp$1@smc.vnet.net> |
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
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
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
csiph-web