How to change tick mark color on image plot.

Hello,
I have a .jpg image that is plotted via image(). I need to have the tick marks inward with 'white' color. I'm able to change the tick marks to inward, but I'm unable to show the tick marks color in 'white'. If I have the tick mark outward, I can see the 'white' tick mark, when I have the tick mark inward, all tick marks just disappeared in the background color of the image. I searched and could not find a solution. May someone please help?
Thank you!

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 6월 21일
I know I've solved the opposite of this problem, where someone needed tick marks covered up; unfortunately I cannot think of the proper keywords to find that newsreader posting now.

댓글을 달려면 로그인하십시오.

 채택된 답변

Yonghe
Yonghe 2011년 6월 22일

1 개 추천

Using 'Layer' property and setting it to top solved my issue. Thank you again for your help!

추가 답변 (2개)

the cyclist
the cyclist 2011년 6월 21일

8 개 추천

The following command will change of the color of the x-axis tick marks and labels:
>> set(gca,'XColor',[1 1 1]); % Set RGB value to what you want

댓글 수: 5

Yonghe
Yonghe 2011년 6월 21일
Hi Cyslist,
Thank you for your help. I tried it before, it does not work if I have the tick mark direction set to 'inward'. The 'white' tick marks only show when it's outward. I need the tick marks to be 'inward'. Anything else you can suggest?
the cyclist
the cyclist 2011년 6월 21일
>> load spine
>> image(X)
>> set(gca,'TickDir','in'); % Were already inward, but just to be sure
>> set(gca,'XColor',[1 1 1])
works for me. But you might consider Walter's idea instead.
Thanks a lot. So simple solution. It's very helpful when using double axis.
Hernan Larriva
Hernan Larriva 2019년 9월 11일
Thanks a lot! Best regards from Barcelona-Spain
Thanks bro, it's work for me.
$ yyaxis left
$ set(gca,'YColor','#080808'); % put hexa color code. (Matlab 2019a)

댓글을 달려면 로그인하십시오.

Walter Roberson
Walter Roberson 2011년 6월 21일

0 개 추천

Consider using the MATLAB File Exchange contribution plt -- if it does not have an option for this, then you should be able to modify the code to handle it.

카테고리

질문:

2011년 6월 21일

댓글:

2021년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by