I'm using gnuplot, and I wonder if it is possible to draw a circle of radius R around a given point (x,y) ?
Answer. Answer: The circle command is used to draw a circle by specifying the center point and radius.
If you don't want to graph a circle, you can use the set object circle
command. You use it like this, for example:
set object X circle at axis 0,0 size scr 0.1 fc rgb "navy"
This will draw a navy blue circle at the origin with a radius of 0.1 of the screen (canvas) size. Note that when you specify a position/radius for the circle you have to specify which coordinate system you are using: first
corresponds to the first x-y coordinate system, scr
(short for screen
) is for screen coordinates. You can learn more by looking in the documentation for drawing circles.
Now if I have many points (in a txt file where each line is x y) and I want to draw a circles which different specified radius for each point. Should I repeat the command "set object i circle at Xi,Yi size first Ri fc rgb "navy"" for each point i ?!
Answer: No!
Plotting with circles
was available in gnuplot V4.4 (2010).
"Circles.dat"
1 1 0.1
2 2 0.2
3 3 0.3
4 4 0.4
5 5 0.5
6 6 0.6
Code:
plot "Circles.dat" u 1:2:3:1 w circles lc var notitle
Result: (created with gnuplot 4.4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With