0

I have a number of points out of a countour plot of a circle. Unfortunately the points are ordered by coordinate position. If I plot the data with "lines" as style data, gnuplot draws lines through my circle. However, I only like to have the circle. How I can change the configuration of gnuplot or do I have the change the order of my points?

1
  • 2
    There is no way for gnuplot to know how you like them to be order, so you will have to do some ordering yourself, which can easily be automated.
    – Bernhard
    Jun 22, 2013 at 13:56

1 Answer 1

0

As Bernhard commented, this is generally not something you can do easily in Gnuplot. However for your particular issue there's a particular solution.

If the points are ordered say by x-coordinate, you can plot first those with a y-coordinate greater than the y-coordinate of the center of the circle, and then in a separate command those with a lower y-coordinate. E.g, for a center on x-axis:

plot 'data' using 1:(($2>=0)?$2:1/0) with lines lt 1
plot 'data' using 1:(($2<=0)?$2:1/0) with lines lt 1

Connecting the two arcs can be done manually using this answer. It could also be done automatically, you would need to save the first and last occurences (gnuplot 4.4 and greater)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .