This script provides a simple way to generate precise contour lines for a 2D function, by adaptively refining the samepling points around the desired contour levels.
Just look at the end of the script to understand how you can use it for yourself ;)