Skip to content
Prev 257337 / 398506 Next

Plotting lines with equidistant points for identification

On 04/19/2011 06:05 PM, Timo Schneider wrote:
Hi Timo,
I don't have time to program this at the moment, but the method isn't 
too hard, assuming that your line is defined by a series of x and y 
coordinates.

Define a function, e.g. equiPoints

Pass the x and y coordinate vectors and the distance between symbols

Start at the leftmost end of the line, recording the x/y coordinates

Calculate the length of successive segments until the cumulative length 
is >= the desired distance

Interpolate the x and y coordinates of the last segment to get the next 
position for a symbol

Add these x and y coordinates to the x and y coordinate vectors

Repeat until you reach the end of the line

Use the symbols function to plot the symbols at the coordinates you have 
calculated

Jim