How can I project my 2-dimensional contour plot onto a sphere in MATLAB?

20 views (last 30 days)
I have created a 2-dimensional contour plot using the CONTOUR function. Now I want to convert this plot into spherical coordinates, i.e., project the contour lines onto a sphere.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Jan 2010
The ability to project contour lines onto a sphere is not available in MATLAB through any built-in functions.
However, with some computations and careful bookkeeping, you can accomplish this, as the attached example illustrates. This file creates a 2-dimensional contour plot, then regenerates it by using the information extracted from the first plot (to demonstrate how the x- and y-coordinates can be read and what they mean), and finally computes the new 3-dimensional lines and plots them on a sphere, preserving all the original colors.

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!