Clear Filters
Clear Filters

How do I draw contours on multiple surfaces so that they line up

13 views (last 30 days)
I have a 3D plot of a 7 2D curves with 6 surfaces drawn so that tthey connect them. Im looking to draw contours on this figure but the only useful comand I can find is
>> contour3([k1;k2], [x1;x2], [z1;z2], 25, 'color', 'k', 'linewidth', 0.1)
where x1 and z1 are the data for my first curve and k1 is used to determine its position in 3D by fixing it. The problem im having is that the command is drawing 25 contours evenly spaced from the maximum value and minimum value out of z1 and z2 causing it to missmatch with 3rd set of contours as z2 has a much greater maximum value compared to z3 and z4. How can i go about creating contours that wont have this problem? The plot with out contours and a plot with contours along with it rotated can be seen below. Hopefully the images illustrates the problem with mismatching contours. Many thanks in advance.

Accepted Answer

Voss
Voss on 17 Jul 2024 at 16:06
Maybe specifying a vector of contour levels, rather than the number of levels, is appropriate. For example:
lev = 0.01:0.01:0.08;
contour3([k1;k2], [x1;x2], [z1;z2], lev, 'color', 'k', 'linewidth', 0.1)

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!