colormap for relative 2d histogram
Mostrar comentarios más antiguos
I have two 2d histograms (in the form of nxm matrices whose elements are populated with 0 or a positive real number). Call them A and B.
I want to overlay A and B to see how they differ, by subtracting so C=A-B, somewhat like in a gene expression map where upregulation is green and downregulation is red. I believe there is a nice colormap available for this already in the File Exchange.
However what I want is somewhat different. If A(25,25)=10.2 and B(25,25)=10.1, so C(25,25)=0.1. Let's also say A(2,1)=0.2 and B(2,1)=0.1, so that C(2,1)=0.1.
I don't want C(25,25) to end up the same color as C(2,1) because I would be losing the information that in both histograms (25,25) is well-populated and (2,1) is not.
One (somewhat still dissatisfactory) solution would be to map the green/red hue of each cell to the sign of the difference A-B so anything positive is green and anything negative is red; and to map the grayscale intensity of the cell to the sum A+B, with white being A+B=0 and black corresponding to some high value.
Does anyone know how to go about doing something like this? It should be simple for someone who knows, but it seems impossible for someone (me) who doesn't! Thanks!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!