Specify value on a contour with a value that is not in the matrix, it is possible ?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gaétan Andriano
le 8 Juil 2021
Commenté : Gaétan Andriano
le 8 Juil 2021
Hello !
I have an interrogation. I have a matrix with m rows and n columns and I plot this matrix with the contour function. In this matrix, there are some values positive and negative. To distinguish negative and positive part I would like to plot a line at 0 but in my matrix, I don't have exactly the value 0. There is a method or a function to help me ?
Thanks in advance
0 commentaires
Réponse acceptée
Star Strider
le 8 Juil 2021
Yes.
M = (-1:0.11:1).'*(-1:0.9:1);
figure
contour(M, 'ShowText','on')
hold on
contour(M, [0 0], 'ShowText','on', 'LineStyle','--','Color','k') % Specific Contour At 0
hold off
This plot already plots the 0 contour, however the second contour call specifically plots the 0 contour with a black dashed line.
.
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Contour Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!