Search code examples
plotgnuplotgeometry

drawing a circle around many points with different radius


I can draw a circle around a given point (x,y) with a command like flowing (here for example point is at (X=5,Y=7) and the circle have a radius R=2.73):

set object 1 circle at 5,7 size first 2.73 fc rgb "navy"

Now, if I have many points (in a txt file where each line is "x y") and I want to draw a circle around each point with different specified radius. Should I repeat the command "set object i circle at Xi,Yi size first Ri fc rgb "navy"" for each point i ?!


Solution

  • It looks like you may want to use the with circles option. If you have a data file with three columns (x y radius), the following command will plot circles with radii from the file at each point:

     plot 'datafile' u 1:2:3 with circles
    

    http://gnuplot.sourceforge.net/demo/circles.html