Color that shows by the imshow, doesn't match to the color that I expect.

2 views (last 30 days)
As you see in these matrix, the third column in second row must be the orange. And the second column in the first row must be the purple, but the figure does not show the correct color. How can i fix this?
  1 Comment
Jan
Jan on 15 Dec 2022
It is easier to check the values, if you post the code as text, not as screenshot.
This is not twitter: No # before the tags. Thanks.

Sign in to comment.

Accepted Answer

millercommamatt
millercommamatt on 15 Dec 2022
Moved: Jan on 15 Dec 2022
This displays as expected for me.
imshow(uint8(cat(3,...
[0 128 0;0 255 255;255 255 255;0 0 0],...
[0 0 0;255 255 128;0 255 0;255 255 255],...
[255 255 0;0 0 0;0 255 255;255 255 255])),'InitialMagnification','fit');
imshow test

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!