Create a black line in imagesc plot
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi everybody,
I've created a 15x15 plot with the boxes showing different colors ranging from dark blue to dark red depending on the connection between x and y. I've been using imagesc.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152885/image.jpeg)
My question is: Is there a way to make a completely black line across the plot in like (1,1), (2,2), (3,3) and so on?
Best regards,
Eric
0 comentarios
Respuestas (2)
harjeet singh
el 27 de Dic. de 2015
hello Eric you may use this code
a=500;
img(1:a,1:a)=5;
figure(1)
imagesc(img);
hold on
b=1:a;
plot(b,b,'k');
drawnow
hold off
0 comentarios
Image Analyst
el 27 de Dic. de 2015
If you want the line in the overlay above the image, you can simply use line() or plot().
If you want the line "burned into" the image, you can follow my attached demo.
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!