MATLAB: Set the Yticklabel to different colors

yticklable color

Hi all, I used this code to set the color of XLable:xlabel('\color{magenta}Love').It works.But I used this way to set the color of Yticklabel,it didn't work(set(h,'Yticklabel',{'\color{magenta}Love','b'})).I want to know how I can set the Yticklabel to different colors.
Thanks for all your kindly answering.

Best Answer

There is no direct mechanism for doing this. The tick labels are not processed through the Interpreter, and are not processed as HTML, and there is no color specifier for them other than the axis color that Elige mentions.
The best you can do is to text() them in to place yourself.