Specify value on a contour with a value that is not in the matrix, it is possible ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Gaétan Andriano
il 8 Lug 2021
Commentato: Gaétan Andriano
il 8 Lug 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 Commenti
Risposta accettata
Star Strider
il 8 Lug 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 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Contour Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!