I have a problem concerning ArcTan drawing a graph using ListPlot. I import a table of data:

a = Import["D:\2_b=10a.txt", "Table"];

Then I write:

ListPlot[Table[{i*0.005 Pi, -ArcTan[(a[[i]][[1]] - 
   a[[i - 1]][[1]]), (a[[i]][[2]] - a[[i - 1]][[2]])]}, {i, 2, 401, 1}]], PlotRange -> {{0, Pi}, {-4, 4}}]

The returned graph looks like


I know from the nature of my calculations that the function must be continuous on the interval $[0,Pi]$, but at $3Pi/4$ the ArcTan function goes to another branch, since ArcTan[x,y] chooses a quadrant. How could I possibly try to move the bottom part of the plot up by Pi, so the function is smooth and continuous?

I tried defining a function

myArcTan[x_] := Piecewise[{{ArcTan[x] + Pi, x < 0}, {ArcTan[x], x > 0}}];

but it doesn't work. Thank you very much.


closed as off-topic by user9660, MarcoB, m_goldberg, Öskå, Edmund Jun 29 '16 at 23:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Community, MarcoB, m_goldberg, Öskå, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ This or this might help. $\endgroup$ – Daniel Lichtblau Aug 14 '14 at 17:42
  • $\begingroup$ Please upload your data or provide a self-contained example. $\endgroup$ – Mr.Wizard Aug 14 '14 at 20:37

Browse other questions tagged or ask your own question.