I'm having trouble to create a plot with equipotential lines in gnuplot. Here is what I got so far:
f(x,y) = atan(y/(x+d))
d = 1.0
set view map
set isosamples 127, 127
unset surface
set contour base
set cntrparam levels discrete pi/4.0
set xrange [ -2.0 : 2.0 ] noreverse nowriteback
set yrange [ -2.0 : 2.0 ] noreverse nowriteback
splot f(x,y) w l
It seems to work well, you can see the line with a gradient of 45°, except for the line at x=-1
:
I think it is because of the singularity in the argument of atan
. In my final plot, there are even more similar singularities with similar lines not fitting into it.
Another thing: The lines should go through [-1,0]
, but you can clearly see a hole in the line. How can I get a clean plot without holes and wrong lines?
- How can i deal with this problem?
- If not, maybe there is another way of plotting equipotential lines?
- As last solution - what do you recommend, if gnuplot is not able to do this?
Thank you :)