Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

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