Overlay imagesc with crosses

16 次查看(过去 30 天)
Sylvain Marchi
Sylvain Marchi 2016-3-8
Hi,
I wonder if it is possible to add crosses at some locations of an imagesc plot, like in the picture below, but with crosses that have the same size as the rectangles containing them?
All help appreciated,
Sylvain
Code used
im=imagesc(magic(3))
hold on
plot(2,2,'marker','x','MarkerSize',20,'Color','white')

回答(1 个)

Walter Roberson
Walter Roberson 2016-3-8
On my system, with the default figure size, it came out as
im=imagesc(magic(3)); axis image; hold on
plot(2,2,'marker','x','MarkerSize',165,'Color','white')
However, if there were any kind of resizing, the marker would stay the same size on the screen rather than resizing with the box. It is therefore better to draw the lines, such as
plot([1.5 2.5 nan 2.5 1.5], [1.5 2.5 nan 1.5 2.5],'Color','white')

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by