Is there a way to make a 4D contour plot?

20 views (last 30 days)
I am looking to visualize some 4 dimensional data. What would the best way to do this be?
I want to create a sort of contour plot but instead of lines, it would show a group of surfaces that represent different cross-sections of the 4D curve.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Jun 2019
You can create a 4D contour plot by using "isosurface" to plot a surface at 1 or more isovalues and setting the 'alpha' of each so that they are slightly transparent.
e.g.
[x,y,z,v] = flow;
levellist = linspace(-10,2,7);
for i = 1:length(levellist)
level = levellist(i);
p = patch(isosurface(x,y,z,v,level));
p.FaceVertexCData = level;
p.FaceColor = 'flat';
p.EdgeColor = 'none';
p.FaceAlpha = 0.3;
end
view(3)
Otherwise, MATLAB has a variety of other methods for visualizing 4D data. Take a look at this documentation link:

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!