0
$\begingroup$

I want to manipulate some data, to do this i create a graph. But i don´t know how to manipulate the data.

SetDirectory["D:\\Documents and Settings\\Física\\Desktop\\Mesa Giratória_com \base"];
dados2 = Import["Dados_Rotacao.txt", "Table"]
Manipulate [ListLinePlot[{dados2, PlotStyle -> {Thick, Dashed, Red}, 
  PlotLabel -> "Gráfico no Eixo X (Visão Vertical)",
  AxesLabel -> {"Posição em x", "Posição em y"}}],dados2,0,20]
$\endgroup$
  • 3
    $\begingroup$ I tried running your code but I got SetDirectory::cdir: "Cannot set current directory to ... and Import::nffil: File not found during Import. >> Pls. help me. $\endgroup$ – rm -rf Dec 22 '15 at 16:08
  • $\begingroup$ The data is in a pen drive. $\endgroup$ – dcvilela Dec 22 '15 at 16:17
  • $\begingroup$ But i can copy here -1.73 24.685 -2.527 23.078 -2.395 21.762 -2.569 20.091 -2.55 18.775 -2.298 17.425 -1.974 16.115 -1.483 15.027 -0.941 14.083 -0.272 13.235 0.434 12.565 1.261 11.881 2.083 11.359 2.936 10.966 3.799 10.72 4.55 10.509 5.403 10.448 6.317 10.583 7.168 10.735 8.022 11.071 8.801 11.475 9.577 12.026 10.239 12.626 10.869 13.35 11.496 14.099 12.11 14.964 12.618 15.874 13.033 16.902 13.511 17.916 13.887 18.892 $\endgroup$ – dcvilela Dec 22 '15 at 16:17
  • $\begingroup$ Its a table with pair of data. {-1.73 ; 24,685} {-2.527 ; 23.078} ....... and on $\endgroup$ – dcvilela Dec 22 '15 at 16:18
4
$\begingroup$
dados2 = {{-1.73, 24.685}, {-2.527, 23.078}, {-2.395, 
   21.762}, {-2.569, 20.091}, {-2.55, 18.775}, {-2.298, 
   17.425}, {-1.974, 16.115}, {-1.483, 15.027}, {-0.941, 
   14.083}, {-0.272, 13.235}, {0.434, 12.565}, {1.261, 
   11.881}, {2.083, 11.359}, {2.936, 10.966}, {3.799, 10.72}, {4.55, 
   10.509}, {5.403, 10.448}, {6.317, 10.583}, {7.168, 10.735}, {8.022,
    11.071}, {8.801, 11.475}, {9.577, 12.026}, {10.239, 
   12.626}, {10.869, 13.35}, {11.496, 14.099}, {12.11, 
   14.964}, {12.618, 15.874}, {13.033, 16.902}, {13.511, 
   17.916}, {13.887, 18.892}}

(* edited in response to query *)
Manipulate[Module[{
   data = dados2[[;; n]],
   plotrange = {Floor@Min[#], Ceiling@Max[#]} & /@ Transpose@dados2
   },
  ListLinePlot[data,
   PlotStyle -> {Thick, Dashed, Red},
   PlotLabel -> "Gráfico no Eixo X (Visão Vertical)",
   AxesLabel -> {"Posição em x", "Posição em y"},
   PlotRange -> plotrange,
   Epilog -> Disk[Last@data, 0.2]]
  ],
 {n, 2, Length[dados2], 1}]
$\endgroup$
  • $\begingroup$ It works! Thanks $\endgroup$ – dcvilela Dec 22 '15 at 16:48
  • $\begingroup$ Is there somehow to put while the graph is plot a point following the dashes, like a little ball making that path? $\endgroup$ – dcvilela Dec 22 '15 at 16:53
  • $\begingroup$ See edit for a simple (but crude) approach. $\endgroup$ – Alan Dec 22 '15 at 20:26

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.