Specify value on a contour with a value that is not in the matrix, it is possible ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Gaétan Andriano
el 8 de Jul. de 2021
Comentada: Gaétan Andriano
el 8 de Jul. de 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 comentarios
Respuesta aceptada
Star Strider
el 8 de Jul. de 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 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!