title: How to add orientation (direction/angle/azimuth) to all points in scatterplot?
body: <p>I am trying to create a scatter plot in R where each point has either an arrow or just a line indicating an "orientation" or a direction associated with that specific point. Each point has a different orientation but all of the orientation lines should be the same length. The angles range from 0-360 degrees with 0 being rightwards and then moving counter clockwise from there. The biggest problem is that my axes are in log scale and the x and y axes increase at different rates which throws off the orientation. My data is a 3x35 matrix with X,Y coordinates and my orientation angle in the third column. </p>
  
  <p>I have tried using the arrows function; however, the arrows don't seem to be pointing in the correct direction and their lengths vary based on the angle. Here is the simple code I used:</p>
  
  <pre><code>plot(data$SF.X., data$TF.Y.,log="xy", pch=19, cex=0.8,ylim=c(0.031,20), xlim = c(0.031,1))
  
  arrows(data$SF.X., data$TF.Y., x1=data$SF.X.+length*cos(data$Degrees), y1=data$TF.Y.+length*sin(data$Degrees), 
         code = 2, length=0.03, col="Red")
  </code></pre>
  
  <p>This the result of the above code:
  <a href="https://i.stack.imgur.com/aN3d8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aN3d8.jpg" alt="enter image description here"></a>
  Can someone point me in the right direction as to how to get my orientation lines all the same length and pointing in the correct direction based on the angle value in my third column?</p>
  
  <p>Thank you so much!</p>
  
  <p>Here is a sample of my data set:</p>
  
  <pre><code>x = c(0.47,0.80,0.09,0.78,0.14)
  
  y = c(2.71,4.51,1.85,5.56,0.98)
  
  orientation (degrees) = c(42.51,9.27,11.31,0.52,93.4)
  </code></pre>