How to show multiple colors in the same slots? (imagesc)

2 views (last 30 days)
Hi all,
I have an imagesc(x,y,A), where A is the index of the best strategy to achieve something, let's say between 1 and 10, as a function of two parameters: x, and y.
I created a colormap to associate to each a color, and in case there are at least two strategies that perform the same an 11th color. to reppresent "Tie", when two strategies have the same score.
Is there a way to show in a single slot multiple colors? (l2 colors would be enough) I was thinking of two triangles colored with the colors of that strategy.
Thank you!

Accepted Answer

DGM
DGM on 8 Apr 2022
Edited: DGM on 8 Apr 2022
If each element of A represents a single "slot", then no. A pixel can be represented by only one color tuple.
If you create a larger image, such that the elements of A are represented as (e.g.) 5x5 superpixels, then you could do something to conditionally subdivide the superpixel into two regions with different colors. You would likely need to also do something to manage the change in axis range so that your labels remain useful.
  2 Comments
Fabio Sartori
Fabio Sartori on 8 Apr 2022
Thanks! that is actually an ok work-around.
I will leave the question open for another couple of days to see if somebody comes up with some "homemade" dirty solution. if not I will accept it as an answer :)
F
Image Analyst
Image Analyst on 8 Apr 2022
I'm waiting to see a mockup of what you have, and what you'd like to have instead.

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!