Overlay imagesc with crosses

16 views (last 30 days)
Sylvain Marchi
Sylvain Marchi on 8 Mar 2016
Answered: Walter Roberson on 8 Mar 2016
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')

Answers (1)

Walter Roberson
Walter Roberson on 8 Mar 2016
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')

Categories

Find more on Graphics Performance 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!