MATLAB: How to realize ‘contour’ plotting with different spacings

contourdifferent spacingsMATLABtoo dense

I want to visualize the potential field of the Earth-Moon system. When I used the contour command, the contour lines which close to the Earth is too dense (see fig.1)
contour( x_EM2 , y_EM2 , V_matrix' , 100 )
If I reduce the quantity of the isolines, the isolines which close to the Moon will vanish (see fig.2).
contour( x_EM2 , y_EM2 , V_matrix' , 20 )
How to realize 'contour' plotting with different spacings or any idea of reducing the isolines close to the Earth without any lost of isolines close to the Moon?
Best Wishes

Best Answer

Instead of calling the function with 100 to get 100 iso-spaced contourlines you should calculate the potential-levels of interest and give that array:
C_levels = C0./linspace(r0,rmax,100); % where C0 R0 and rmax are for you to choose
contour( x_EM2 , y_EM2 , V_matrix' , C_levels )
HTH
Related Question