0
votes

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

2

2 Answers

2
votes

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

0
votes

You can create a loop in gnuplot for multiple circles.

do for[k=1:20]{
   set object k circle front at k*3,0 size 1 fillcolor rgb "black" lw 1  
}

This will create 20 circles at x points (3,6,9...) of radius 1. Please keep in mind to set the object count with the loop variable too ("object k").