Here’s the content of the script I will use with gnuplot to make a graph of a circle using Cartesian coordinates. Save the file as ‘circle.gpt’ and run as a script with command ‘gnuplot circle.gpt’. Alternatively you could write the commands in gnuplot using the interactive mode.
set terminal png set nokey set xrange[-10:10] set yrange[-10:10] set output "circle.png" set samples 100000 r = 5.0 ## radius a = 3.0 ## x shift b = 4.0 ## y shift f1(x) = sqrt(r**2 - (x-a)**2) - b f2(x) = sqrt(r**2 - (x-a)**2) + b plot f1(x) lw 3, -1*f2(x) lw 3 lt 1

For notation I followed the great handout available here: http://www.eclecticon.info/maths%20-%20geometry.htm — topic of the handout is Cartesian equation of a circle.
Explanation from Khan academy