Specify value on a contour with a value that is not in the matrix, it is possible ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gaétan Andriano
am 8 Jul. 2021
Kommentiert: Gaétan Andriano
am 8 Jul. 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 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Jul. 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 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!