Is there anyway to interactively change the color of a data point in an imagesc plot?
4 views (last 30 days)
Show older comments
Say I had an imagesc plot and wanted to change one of the values from black to white. Is there anyway to do that in the plot itself, or is there any way to maybe use a GUI to allow the user to do that?
Here is the code for reference
nRows = 20;
nCols = 50;
Matrix = zeros(nRows,nCols);
Rndm = randi([0 1],size(Matrix));
imagesc(Rndm)
colormap(gca, gray)
4 Comments
Walter Roberson
on 25 Jan 2020
Well, you could do it with techniques such as first converting your image to rgb using mat2gray() followed by im2uint8() followed by ind2rgb() . After that, you could use ginput() or similar to designate points you wanted to change the color of, and some kind of interface indicating the color you wanted to change to, and store the results in a matrix .
Answers (1)
See Also
Categories
Find more on Color and Styling 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!