Is there anyway to interactively change the color of a data point in an imagesc plot?

3 visualizaciones (últimos 30 días)
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 comentarios
Walter Roberson
Walter Roberson el 25 de En. de 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 .
Alex Weaver
Alex Weaver el 25 de En. de 2020
I don’t have access to a computer at the moment but I will try that tomorrow, thank you!

Iniciar sesión para comentar.

Respuestas (1)

Alex Weaver
Alex Weaver el 28 de En. de 2020
That did the trick, thank you for the help!

Categorías

Más información sobre Color and Styling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by