Effacer les filtres
Effacer les filtres

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

13 vues (au cours des 30 derniers jours)
Rowan
Rowan le 17 Juil 2024 à 15:59
Commenté : Voss le 18 Juil 2024 à 13:07
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.

Réponse acceptée

Voss
Voss le 17 Juil 2024 à 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)
  2 commentaires
Rowan
Rowan le 18 Juil 2024 à 9:51
This is perfect, thank you!
Voss
Voss le 18 Juil 2024 à 13:07
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by