Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Plotting a data from a matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi I have a matrix where there are 11 rows and 198 columns. The values range between -1 to +1. I would like to plot the values (1 to 198 on x axis and 11 (random 11 sets)) in such a way that the positive values get red colour and the negative values get blue colour. How do I go about it? Thanks
0 comentarios
Respuestas (1)
Walter Roberson
el 2 de Jun. de 2015
colidx = 1 + (YourMatrix >= 0);
surf(YourMatrix, colidx);
colormap([0 0 1; 1 0 0]); %blue; red
If you are thinking of a line plot then you need to define what should happen for lines that go between positive and negative points. You might want
mesh(YourMatrix, colidx);
1 comentario
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!