필터 지우기
필터 지우기

Create a black line in imagesc plot

조회 수: 14 (최근 30일)
Eric
Eric 2015년 12월 27일
답변: Image Analyst 2015년 12월 27일
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.
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

답변 (2개)

harjeet singh
harjeet singh 2015년 12월 27일
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

Image Analyst
Image Analyst 2015년 12월 27일
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.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by