Creating a customized grid on a imagesc() figure
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a matrix of values between -1 and 1, I look it up with imagesc().
I would like to trace a customized grid over that image to delimit portions of the "matrix" (datapoints that share a common property).
I thougt it would work to make up a second matrix with lines and rows full of NaNs or Inf or some special value.
But imagesc() will trace NaN and Inf in the color of the min and max in the matrix, not some special color.
So, is there a way to trace a grid on top of imagesc(), or to set the colormap in such a way that Inf (for example) are renderred black and the other values are renderred as in the normal colormap "jet"?
Thank you very much laurie
0 comentarios
Respuesta aceptada
Walter Roberson
el 20 de Abr. de 2012
Create a second image located at exactly the same position as the first, with the lines that you want, and with AlphaData set to 0 where the underlying image should show through, and 1 where the overlay should show through. The second image would have to be truecolor (RGB) to use different colors than are in the original image. Note that if you do this then you will need to use the OpenGL renderer as it is the only one that supports transparency.
Alternately after drawing your base image, use line() specifying RGB colors to draw on the grid.
It is not possible to "exempt" particular values from the colormap: if you are using pseudocolor then every color in the image must appear somewhere in the colormap.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Orange 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!