Overlay imagesc with crosses

18 ビュー (過去 30 日間)
Sylvain Marchi
Sylvain Marchi 2016 年 3 月 8 日
回答済み: Walter Roberson 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 Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by