![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176661/image.png)
How to put tick in front of a picture?
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to use imagesc but it covers xticks, yticks. Is it possible to uncover them?
0 Kommentare
Antworten (2)
Star Strider
am 15 Jan. 2017
Using the Layer axis property also works:
PB2 = imread('Cj0MdYJUoAAReUH.jpg');
figure(1)
imagesc(PB2)
set(gca, 'Layer','top')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176661/image.png)
4 Kommentare
Image Analyst
am 15 Jan. 2017
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
am 15 Jan. 2017
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
am 15 Jan. 2017
Bearbeitet: Image Analyst
am 7 Okt. 2019
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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176650/image.png)
1 Kommentar
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!