How to put tick in front of a picture?

28 ビュー (過去 30 日間)
Mr M.
Mr M. 2017 年 1 月 15 日
編集済み: Image Analyst 2019 年 10 月 7 日
I would like to use imagesc but it covers xticks, yticks. Is it possible to uncover them?

回答 (2 件)

Star Strider
Star Strider 2017 年 1 月 15 日
Using the Layer axis property also works:
PB2 = imread('Cj0MdYJUoAAReUH.jpg');
figure(1)
imagesc(PB2)
set(gca, 'Layer','top')
  4 件のコメント
Image Analyst
Image Analyst 2017 年 1 月 15 日
Now your tick marks are on the inside of the axes box, and mine are on the outside. I know that you can set a default in setiptprefs() for whether or not you want the tick marks and labels to be shown by default when you call imshow(). But after a quick look in the help I didn't see where you could set the tick mark style as 'outside', 'inside', or 'crossing' though I think it's there somewhere. Do you know how to do that?
Star Strider
Star Strider 2017 年 1 月 15 日
In R2016b (and the other more recent releases), that would be:
set(gca, 'TickDir', 'out')
or:
set(gca, 'TickDir', 'both')
I tested these and will post the results if you want me to. This is in the Axis Properties documentation.

サインインしてコメントする。


Image Analyst
Image Analyst 2017 年 1 月 15 日
編集済み: Image Analyst 2019 年 10 月 7 日
Use imshow followed by axis on:
imshow(yourImage);
axis on;
You'll get tick marks outside the axes box (which you can also turn on or off if you want).
  1 件のコメント
Adam Danz
Adam Danz 2019 年 10 月 6 日
How can this answer not have 1000 votes?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by