how to realize 'contour' plotting with different spacings?
3 views (last 30 days)
Show older comments
Yifan
on 28 May 2015
Edited: Vaibhavi Kavathekar
on 9 Feb 2022
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
0 Comments
Accepted Answer
Bjorn Gustavsson
on 28 May 2015
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
2 Comments
Vaibhavi Kavathekar
on 9 Feb 2022
Edited: Vaibhavi Kavathekar
on 9 Feb 2022
Okay , I'm trying to do the same for my contour plot, just not able to figure out how should I choose values for C0,R0,Rmax. Not clear with what the C_levels func is doing.
More Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!