4
$\begingroup$

Hi I have a question on how can I create a moving dot that moves across my x-y graph?

I have tried using this following method, but it didn't seem to be working. Appreciate some guidance in this request. Thank you

T2={{1, 0.0112401}, {2, 0.022343}, {3, 0.0263601}, {4, 0.0362769}, {5,0.0487026}, {6, 0.0443083}, {7, 0.0568229}, {8, 0.0678723}, {9,  0.0811323}, {10, 0.097095}, {11, 0.108599}, {12, 0.117516}, {13,  0.116033}, {14, 0.123398}, {15, 0.132743}, {16, 0.161855}, {17, 0.17821}, {18, 0.19983}, {19, 0.215085}, {20, 0.230042}, {21, 0.245152}, {22, 0.256659}, {23, 0.29094}, {24, 0.313128}, {25,  0.332704}, {26, 0.347681}, {27, 0.352949}, {28, 0.36762}, {29, 0.385261}, {30, 0.402488}, {31, 0.419664}, {32, 0.439505}, {33, 0.453793}, {34, 0.470486}, {35, 0.484415}, {36, 0.497896}, {37,0.490522}, {38, 0.499663}, {39, 0.511091}, {40, 0.52268}, {41, 0.533932}, {42, 0.555661}, {43, 0.567415}, {44, 0.572884}, {45,0.567147}, {46, 0.574664}, {47, 0.608129}, {48, 0.62387}, {49,     0.637212}, {50, 0.64965}, {51, 0.662974}, {52, 0.675886}, {53, 
0.691763}, {54, 0.705568}, {55, 0.731485}, {56, 0.748551}, {57,     0.758743}, {58, 0.767238}, {59, 0.766288}, {60, 0.772383}, {61,    0.782023}, {62, 0.793665}, {63, 0.804935}, {64, 0.818836}, {65,     0.819112}, {66, 0.825337}, {67, 0.835475}, {68, 0.843533}, {69, 
0.852473}, {70, 0.863136}, {71, 0.874376}, {72, 0.884065}, {73,     0.896049}, {74, 0.919291}, {75, 0.928924}, {76, 0.938271}, {77,     0.949309}, {78, 0.958934}, {79, 0.967867}, {80, 0.981607}, {81, 0.995885},{82,1.00496}, {83, 1.00719}, {84, 1.00969}, {85, 1.01714}, {86, 1.02149}, {87, 1.01623}, {88, 1.01631}, {89,1.02142}, {90, 1.03236}, {91, 1.03669}, {92, 1.02906}, {93,0.996826}, {94, 0.988097}, {95, 0.983169}, {96, 0.980775}, {97, 0.976756}, {98, 0.977636}, {99, 0.983602}, {100, 0.978509}, {101, 0.969899}, {102, 0.954121}, {103, 0.934998}, {104, 0.921765}, {105, 0.908276}, {106, 0.896375}, {107, 0.893725}, {108, 0.898385}, {109, 0.895399}, {110, 0.885013}, {111, 0.874369}, {112, 0.862155}, {113, 0.849159}, {114, 0.835289}, {115, 0.823404}, {116, 0.811731}, {117, 0.802256}, {118, 0.790971}, {119, 0.781269}, {120, 0.772227}, {121, 0.760161}, {122, 0.757806}, {123, 0.759711}, {124, 0.745768}, {125, 0.726615}, {126, 0.713928}, {127, 0.690882}, {128, 0.679276}, {129, 0.668908}, {130, 0.658134}, {131, 0.647189}, {132, 0.627712}, {133, 0.608217}, {134, 0.598766}, {135, 0.59163}, {136, 0.577777}, {137, 0.562699}, {138, 0.55212}, {139, 0.53906}, {140, 0.524086}, {141, 0.514294}, {142, 0.521793}, {143, 0.524009}, {144, 0.513735}, {145,0.50444}, {146, 0.501487}, {147, 0.493977}, {148, 0.484264}, {149,0.474307}, {150, 0.446472}, {151, 0.430637}, {152, 0.425283}, {153, 0.416983}, {154, 0.411584}, {155, 0.402813}, {156, 0.392583}, {157, 0.382946}, {158, 0.380009}, {159, 0.366859}, {160, 0.37188}, {161,0.369591}, {162, 0.357719}, {163, 0.34596}, {164, 0.336107}, {165, 0.318984}, {166, 0.305196}, {167, 0.298694}, {168, 0.291633}, {169,0.286417}, {170, 0.278256}, {171, 0.27013}, {172, 0.260233}, {173, 0.252056}, {174, 0.247655}, {175, 0.262472}, {176, 0.256001}, {177, 0.247901}, {178, 0.24132}, {179, 0.236862}, {180, 0.220253}, {181, 0.200585}, {182, 0.193203}, {183, 0.186051}, {184, 0.17888}, {185, 0.169314}, {186, 0.162002}, {187, 0.153258}, {188, 0.147994}, {189, 0.147201}, {190, 0.155915}, {191, 0.163627}, {192, 0.163209}, {193, 0.163929}, {194, 0.165888}, {195, 0.170515}, {196, 0.177012}, {197, 0.183683}, {198, 0.190691}, {199, 0.198855}, {200, 0.209411}, {201, 0.219823}, {202, 0.236172}, {203, 0.249048}, {204, 0.259256}, {205, 0.268374}, {206, 0.279025}, {207, 0.290684}, {208, 0.302826}, {209, 0.311628}, {210, 0.307288}, {211, 0.318827}, {212, 0.330614}, {213, 0.342739}, {214, 0.355085}, {215, 0.367607}, {216, 0.375536}, {217, 0.381194}, {218, 0.392385}, {219, 0.406059}, {220, 0.436868}, {221, 0.449512}, {222, 0.461532}, {223, 0.471098}, {224, 0.479394}, {225, 0.490446}, {226, 0.502107}, {227, 0.514445}, {228, 0.526378}, {229,0.536976}, {230, 0.542608}, {231, 0.53443}, {232, 0.545981}, {233, 0.55749}, {234, 0.568624}, {235, 0.573747}, {236, 0.588916}, {237, 0.591278}, {238, 0.599979}, {239, 0.610403}, {240, 0.628561}, {241, 0.650838}, {242, 0.662773}, {243, 0.674804}, {244, 0.686279}, {245, 0.694081}, {246, 0.705992}, {247, 0.717993}, {248, 0.729708}, {249, 0.741478}, {250, 0.753205}, {251, 0.764925}, {252, 0.783898}, {253, 0.798617}, {254, 0.799193}, {255, 0.816059}, {256, 0.82709}, {257, 0.834357}, {258, 0.840939}, {259, 0.848954}, {260, 0.847393}, {261, 0.855234}, {262, 0.862009}, {263, 0.870614}, {264, 0.879861}, {265, 0.892015}, {266, 0.900128}, {267, 0.907882}, {268, 0.915618}, {269, 0.911163}, {270, 0.930533}, {271, 0.944394}, {272, 0.951719}, {273,0.952381}, {274, 0.957695}, {275, 0.962802}, {276, 0.967579}, {277, 0.951706}, {278, 0.94967}, {279, 0.971899}, {280, 0.977326}, {281, 0.974856}, {282, 0.971937}, {283, 0.969697}, {284, 0.966139}, {285, 0.961206}, {286, 0.954197}, {287, 0.97078}, {288, 0.976536}, {289, 0.966951}, {290, 0.957197}, {291, 0.94712}, {292, 0.937832}, {293, 0.925659}, {294, 0.913847}, {295, 0.903382}, {296, 0.892735}, {297, 0.880239}, {298, 0.870477}, {299, 0.858327}, {300, 0.840539}, {301, 0.82854}, {302, 0.816586}, {303, 0.805597}, {304, 0.793643}, {305, 0.780859}, {306, 0.770304}, {307, 0.759171}, {308, 0.742474}, {309, 0.724394}, {310, 0.713957}, {311, 0.703705}, {312, 0.692677}, {313, 0.682061}, {314, 0.67217}, {315, 0.66777}, {316, 0.656764}, {317, 0.646492}, {318, 0.635552}, {319, 0.622091}, {320, 0.608306}, {321, 0.598062}, {322, 0.58553}, {323, 0.576042}, {324, 0.566523}, {325, 0.556752}, {326, 0.546478}, {327, 0.528112}, {328, 0.520846}, {329, 0.516951}, {330, 0.50713}, {331, 0.496752}, {332, 0.48721}, {333, 0.476146}, {334, 0.46395}, {335, 0.455922}, {336, 0.446946}, {337, 0.438517}, {338, 0.429252}, {339, 0.42284}, {340, 0.419418}, {341, 0.413753}, {342, 0.410108}, {343, 0.399898}, {344, 0.395176}, {345, 0.386337}, {346, 0.378278}, {347, 0.37036}, {348, 0.36261}, {349, 0.353596}, {350, 0.343423}, {351, 0.332019}, {352, 0.323621}, {353, 0.317032}, {354, 0.311555}, {355, 0.304342}, {356, 0.297222}, {357, 0.289849}, {358, 0.282104}, {359, 0.271631}, {360, 0.265398}, {361, 0.261565}, {362, 0.257214}, {363, 0.252361}, {364, 0.244798}, {365, 0.233466}, {366, 0.224587}, {367, 0.218883}, {368, 0.213349}, {369, 0.20849}, {370, 0.201247}, {371, 0.191679}, {372, 0.18405}, {373, 0.181088}, {374, 0.17555}, {375, 0.171433}, {376, 0.167943}, {377, 0.157542}, {378, 0.145801}, {379, 0.143661}, {380, 0.140433}, {381, 0.137398}, {382, 0.140605}, {383, 0.145362}, {384, 0.150634}, {385, 0.156802}, {386, 0.162594}, {387, 0.1779}, {388, 0.188464}, {389, 0.196758}, {390, 0.202399}, {391, 0.193614}, {392, 0.199477}, {393, 0.215322}, {394, 0.226329}, {395, 0.23282}, {396, 0.246301}, {397, 0.256836}, {398, 0.266593}, {399, 0.276982}, {400, 0.294606}, {401, 0.329491}, {402, 0.337872}, {403, 0.349091}, {404, 0.358959}, {405, 0.36186}, {406, 0.370971}, {407, 0.384777}, {408, 0.398883}, {409, 0.412696}, {410, 0.425588}, {411, 0.437482}, {412, 0.45202}, {413, 0.454278}, {414, 0.44602}, {415, 0.464273}, {416, 0.476484}, {417,0.491644}, {418, 0.500362}, {419, 0.508877}, {420, 0.521899}, {421, 0.536665}, {422, 0.547488}, {423, 0.562322}, {424, 0.574938}, {425, 0.593064}, {426, 0.604548}, {427, 0.614988}, {428, 0.626681}, {429, 0.6388}, {430, 0.651382}, {431, 0.66329}, {432, 0.677815}, {433, 0.691974}, {434, 0.705894}, {435, 0.70884}, {436, 0.718423}, {437, 0.724762}, {438, 0.734691}, {439, 0.736046}, {440, 0.735594}, {441, 0.717698}, {442, 0.723865}, {443, 0.738728}, {444, 0.768839}, {445, 0.781534}, {446, 0.788826}, {447, 0.800653}, {448, 0.81066}, {449, 0.820746}, {450, 0.830441}, {451, 0.868256}, {452, 0.876591}, {453, 0.884302}, {454, 0.89323}, {455, 0.909827}, {456, 0.919959}, {457, 0.923027}, {458, 0.894536}, {459, 0.907852}, {460, 0.904349}, {461, 0.900357}, {462, 0.904497}, {463, 0.904759}, {464, 0.880968}, {465, 0.883222}, {466, 0.888369}, {467, 0.890022}, {468, 0.92604}, {469, 0.923976}, {470, 0.922242}, {471, 0.919241}, {472, 0.903138}, {473, 0.898876}, {474, 0.91609}, {475, 0.916485}, {476, 0.90481}, {477, 0.886787}, {478, 0.876415}, {479, 0.867775}, {480, 0.856937}, {481, 0.845024}, {482, 0.844427}, {483, 0.832879}, {484, 0.82237}, {485, 0.799199}, {486, 0.799121}, {487, 0.799325}, {488, 0.790604}, {489, 0.781691}, {490, 0.770114}, {491, 0.760827}, {492, 0.748803}, {493, 0.738875}, {494, 0.731529}, {495, 0.731426}, {496, 0.720417}, {497, 0.711111}, {498, 0.699878}, {499, 0.68885}, {500, 0.678434}, {501, 0.667205}, {502, 0.657046}, {503, 0.648564}, {504, 0.631812}, {505, 0.601248}, {506, 0.58764}, {507, 0.578173}, {508, 0.567718}, {509, 0.55793}, {510, 0.548545}, {511, 0.539473}, {512, 0.530572}, {513, 0.520992}, {514, 0.511822}, {515, 0.521504}, {516, 0.522223}, {517, 0.514331}, {518, 0.505063}, {519, 0.495923}, {520, 0.487122}, {521, 0.478077}, {522, 0.468316}, {523, 0.458937}, {524, 0.450867}, {525, 0.441426}, {526, 0.434465}, {527, 0.426813}, {528, 0.419287}, {529, 0.417928}, {530, 0.409877}, {531, 0.4017}, {532, 0.392996}, {533, 0.384495}, {534, 0.374743}, {535, 0.365515}, {536, 0.358262}, {537, 0.353975}, {538, 0.349303}, {539, 0.342387}, {540, 0.335069}, {541, 0.323119}, {542, 0.315337}, {543, 0.308303}, {544, 0.301252}, {545, 0.29436}, {546, 0.288503}, {547, 0.266421}, {548, 0.251189}, {549, 0.241989}, {550, 0.23755}, {551, 0.230337}, {552, 0.222408}, {553, 0.215273}, {554, 0.207684}, {555, 0.199417}, {556, 0.191178}, {557, 0.196422}, {558, 0.188913}, {559, 0.177171}, {560, 0.170548}, {561, 0.162049}, {562, 0.150985}, {563, 0.144431}, {564, 0.141049}, {565, 0.137908}, {566, 0.136632}, {567, 0.137071}, {568, 0.145694}, {569, 0.150076}, {570, 0.153613}, {571, 0.158371}, {572, 0.163691}, {573, 0.16962}, {574, 0.173376}, {575, 0.176676}, {576, 0.181713}, {577, 0.189215}, {578, 0.197361}, {579, 0.205563}, {580, 0.214324}, {581, 0.22412}, {582, 0.235061}, {583, 0.243726}, {584, 0.257348}, {585, 0.268877}, {586, 0.281203}, {587, 0.294362}, {588, 0.307851}, {589, 0.317498}, {590, 0.328541}, {591, 0.343026}, {592, 0.355831}, {593, 0.366219}, {594, 0.376702}, {595, 0.388668}, {596, 0.401032}, {597, 0.414086}, {598, 0.424178}, {599, 0.432339}, {600, 0.441781}, {601, 0.451058}, {602, 0.461219}, {603, 0.471965}, {604, 0.484733}, {605, 0.501561}, {606, 0.51159}, {607, 0.522245}, {608, 0.538202}, {609, 0.550281}, {610, 0.560445}, {611, 0.573408}, {612, 0.585695}, {613, 0.596944}, {614, 0.608875}, {615, 0.622244}, {616, 0.635424}, {617, 0.642511}, {618, 0.649509}, {619, 0.658128}, {620, 0.66921}, {621, 0.680649}, {622, 0.690928}, {623, 0.702191}, {624, 0.714233}, {625, 0.727145}, {626, 0.739632}, {627, 0.748111}, {628, 0.755777}, {629, 0.766895}, {630, 0.771662}, {631, 0.773664}, {632, 0.783403}, {633, 0.792299}, {634, 0.801217}, {635, 0.808808}, {636, 0.82186}, {637, 0.837533}, {638, 0.856311}, {639, 0.867197}, {640, 0.875093}, {641, 0.88722}, {642, 0.892282}, {643, 0.899269}, {644, 0.906552}, {645, 0.915291}, {646, 0.919868}, {647, 0.926978}, {648, 0.935044}, {649, 0.940543}, {650, 0.945371}, {651, 0.951375}, {652, 0.956947}, {653, 0.959758}, {654, 0.960519}, {655, 0.953618}, {656, 0.928878}, {657, 0.918485}, {658, 0.914795}, {659, 0.910633}, {660, 0.904584}, {661, 0.898398}, {662, 0.893498}, {663, 0.885995}, {664, 0.87647}, {665, 0.865368}, {666, 0.87501}, {667, 0.870546}, {668, 0.860912}, {669, 0.850276}, {670, 0.848074}, {671, 0.847187}, {672, 0.835328}, {673, 0.823427}, {674, 0.805799}, {675, 0.788606}, {676, 0.777284}, {677, 0.764236}, {678, 0.750541}, {679, 0.739926}, {680, 0.730513}, {681, 0.719861}, {682, 0.709108}, {683, 0.69506}, {684, 0.689239}, {685, 0.687194}, {686, 0.676615}, {687, 0.664263}, {688, 0.653418}, {689, 0.644417}, {690, 0.635262}, {691, 0.625279}, {692, 0.61707}, {693, 0.613761}, {694, 0.60402}, {695, 0.590617}, {696, 0.585398}, {697, 0.576296}, {698, 0.565258}, {699, 0.555742}, {700, 0.546615}, {701, 0.532848}, {702, 0.510278}, {703, 0.500912}, {704, 0.491602}, {705, 0.482011}, {706, 0.47365}, {707, 0.458868}, {708, 0.450894}, {709, 0.442507}, {710, 0.436178}, {711, 0.432999}, {712, 0.436742}, {713, 0.429549}, {714, 0.419904}, {715, 0.4111}, {716, 0.40173}, {717, 0.393512}, {718, 0.385895}, {719, 0.377932}, {720, 0.369391}, {721, 0.362552}, {722, 0.364768}, {723, 0.360805}, {724, 0.346832}, {725, 0.337618}, {726, 0.331494}, {727, 0.324333}, {728, 0.297665}, {729, 0.280347}, {730, 0.263427}, {731, 0.251005}, {732, 0.23989}, {733, 0.234607}, {734, 0.228142}, {735, 0.2221}, {736, 0.207333}, {737, 0.189636}, {738, 0.197176}, {739, 0.205317}, {740, 0.204353}, {741, 0.197061}, {742, 0.187798}, {743, 0.178847}, {744, 0.171033}, {745, 0.163363}, {746, 0.166014}, {747, 0.174052}, {748, 0.165874}, {749, 0.159694}, {750, 0.155259}, {751, 0.153506}, {752, 0.153079}, {753, 0.15444}, {754, 0.162926}, {755, 0.165396}, {756, 0.165618}, {757, 0.168022}, {758, 0.171454}, {759, 0.175181}, {760, 0.173191}, {761, 0.172892}, {762, 0.180117}, {763, 0.18878}, {764, 0.196281}, {765, 0.199669}, {766, 0.205576}, {767, 0.213666}, {768, 0.216826}, {769, 0.217476}, {770, 0.231338}, {771, 0.240421}, {772, 0.248152}, {773, 0.256712}, {774, 0.265477}, {775, 0.274865}, {776, 0.285057}, {777, 0.291754}, {778, 0.307249}, {779, 0.330527}, {780, 0.347037}, {781, 0.361558}, {782, 0.3732}, {783, 0.384773}, {784, 0.396651}, {785, 0.401916}, {786, 0.413668}, {787, 0.425616}, {788, 0.437004}, {789, 0.448976}, {790, 0.440723}, {791, 0.436915}, {792, 0.446628}, {793, 0.458218}, {794, 0.466577}, {795, 0.480816}, {796, 0.493102}, {797, 0.505578}, {798, 0.515489}, {799, 0.525491}, {800, 0.548119}, {801, 0.566464}, {802, 0.581826}, {803, 0.594545}, {804, 0.605672}, {805, 0.622615}, {806, 0.636107}, {807, 0.636717}, {808, 0.626343}, {809, 0.632191}, {810, 0.632083}, {811, 0.627469}, {812, 0.635509}, {813, 0.634595}, {814, 0.628782}, {815, 0.630209}, {816, 0.640058}, {817, 0.655163}, {818, 0.689469}, {819, 0.701112}, {820, 0.727978}, {821,0.760009}, {822, 0.770128}, {823, 0.795929}, {824, 0.819729}, {825, 0.83549}, {826, 0.846679}, {827, 0.855764}, {828, 0.849243}, {829, 0.842519}, {830, 0.83187}, {831, 0.831943}, {832, 0.83652}, {833, 0.845494}, {834, 0.85438}, {835, 0.85183}, {836, 0.841675}, {837, 0.845407}, {838, 0.852784}, {839, 0.867412}, {840, 0.8922}, {841, 0.903508}, {842, 0.909518}, {843, 0.910355}, {844, 0.896117}, {845, 0.887979}, {846, 0.900502}, {847, 0.897136}, {848, 0.894085}, {849, 0.891468}, {850, 0.894436}, {851, 0.888543}, {852, 0.885088}, {853, 0.87653}, {854, 0.869081}, {855, 0.864086}, {856, 0.850989}, {857, 0.832026}, {858, 0.825431}, {859, 0.813529}, {860, 0.794677}, {861, 0.783225}, {862, 0.771318}, {863, 0.759964}, {864, 0.744705}, {865, 0.734917}, {866, 0.73145}, {867, 0.728872}, {868, 0.717384}, {869, 0.70041}, {870, 0.679582}, {871, 0.668278}, {872, 0.657044}, {873,0.642587}, {874, 0.63147}, {875, 0.622342}, {876, 0.607175}, {877, 0.596577}, {878, 0.585202}, {879, 0.585089}, {880, 0.590392}, {881, 0.581249}, {882, 0.575957}, {883, 0.569544}, {884, 0.568808}, {885,0.563904}, {886, 0.548982}, {887, 0.539654}, {888, 0.533513}, {889, 0.533614}, {890, 0.525223}, {891, 0.517285}, {892, 0.506851}, {893, 0.499582}, {894, 0.491503}, {895, 0.46473}, {896, 0.454239}, {897, 0.445136}, {898, 0.436708}, {899, 0.429933}, {900, 0.41534}, {901,  0.411219}, {902, 0.390568}, {903, 0.377264}, {904, 0.368766}, {905, 0.368548}, {906, 0.361501}, {907, 0.347137}, {908, 0.337336}, {909, 0.325264}, {910, 0.326554}, {911, 0.322696}, {912, 0.321376}, {913, 0.314751}, {914, 0.30571}, {915, 0.305969}, {916, 0.300617}, {917, 0.296308}, {918, 0.289232}, {919, 0.282972}, {920, 0.276334}, {921, 0.261724}, {922, 0.260585}, {923, 0.258559}, {924, 0.251587}, {925, 0.237995}, {926, 0.231108}, {927, 0.224629}, {928, 0.21844}}


ListLinePlot[T2];
ndata = Length[T2];



T3 = Table[
   Graphics[{Line[T2], Point[T2]}, PlotRange -> {{0, 928}}], {i, 1, 
    ndata}];

ListAnimate[T3]
$\endgroup$
7
$\begingroup$
Animate[ListLinePlot[T2, 
  Epilog -> {PointSize[Large], Red, Point @ T2[[t]]}], {t, 1, Length @ T2, 1}]

enter image description here

Alternatively,

Animate[ListLinePlot[T2, 
     Mesh -> {{t}}, 
     MeshFunctions -> {# &}, 
     MeshStyle -> Directive[PointSize[Large], Red]], 
  {t, T2[[All, 1]]}]

same picture

$\endgroup$
3
$\begingroup$

There are many ways to do this. But here is a quick attempt to get you started

T2 = {{1, 0.0112401}, {2, 0.022343}, {3, 0.0263601}, {4, 
    0.0362769}, {5, 0.0487026}, {6, 0.0443083}, {7, 0.0568229}, {8, 
    0.0678723}};
Animate[Grid[
  {
   {Row[{"point ", i, " = ", T2[[i]]}]},
   {Graphics[{PointSize[.04], Point[ T2[[i]]]}, Frame -> True, 
     PlotRange -> {{0, 8}, {-3, 3}}]}}, Spacings -> {1, 1}
  ] , {i, 1, Length@T2, 1}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you may I ask if there a way to show the x-y data together with the moving dot? $\endgroup$ – Boajj04 Oct 25 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.