Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
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 '13 at 13:56

1 Answer 1

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.