Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1271
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Using Nearest on a group of points |
| Date | 2011-03-30 09:13 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <imus8b$i4e$1@smc.vnet.net> (permalink) |
| References | <im9sk8$g5j$1@smc.vnet.net> <imc952$1ke$1@smc.vnet.net> <imfae8$iue$1@smc.vnet.net> <imshcc$5oo$1@smc.vnet.net> |
Am 29.03.2011 13:55, schrieb Martin Vavpotič:
> I did my own version of it and it looks like this:
>
> Manipulate[Block[{spl = ListLinePlot[Final, PlotRange -> {{0, 2}, {1,
> 6.5}}]},
> Show[spl, Graphics[{Red, PointSize[.02], Point[{Final[[j, 1]],
> Final[[j, 2]]}]}]]], {j, 1, 187}] (I believe the brackets are fine.)
>
> Final is a 187=D72 Table with x,y values of the graph. The animation
> itself works like it should, but a few of the frames turn a red
> background and I get these warnings:
>
> Part::pspec: Part specification 89.4` is neither an integer nor a list
> of integers.>>
>
> Am I doing something wrong?
>
> Martin
>
> On 24 mar., 12:37, Peter Pein<pet...@dordos.net> wrote:
>>
>> the dot can be done with:
>>
>> Manipulate[Block[{spl=Plot[Sin[x],{x,0,2Pi}]},
>> Show[spl,Graphics[{Red,PointSize[.02],Point[{x0,Sin[x0]}]}]]],
>> {x0,0,2Pi}]
>>
>> and I didn't try out, but I guess the Animation should depend on x0 too
>> and reside inside the Show[].
>>
>> Peter
>
>
Oh dear, it's not too obvious:
you use j as (integer) index. Take care that j takes only integer values:
Manipulate[......,{j,1,187,1}]
should do.
Cheers,
Peter
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Using Nearest on a group of points Peter Pein <petsie@dordos.net> - 2011-03-30 09:13 +0000
csiph-web