MATLAB: How to change the font of ticks in a colorbar

colorbarinterpreterlatexticks

I have a matlab polt and everything like label and title is interpreted in latex style. There is also a colorbar in this figure and I want the ticks at this colorbar in latex style too.
For the rest I have code like this
if true
set(0,'DefaultTextInterpreter','latex')
set(0,'DefaultLegendInterpreter','latex')
end
and it runs very good, but I can't find kind of this code for the ticks at the colorbar.
Would be really nice if someone's out there who can help me 😉

Best Answer

Changing the TickLabelInterpreter won't make it match the latex serif roman numbering style, which is what I assume you want to do. However, you can change the FontName property.
A good set of fonts that match the LaTeX fonts can be downloaded here: Computer Modern Unicode fonts
You will need 7zip to unpack the archive and then you will have to install a font of your choice (in Windows, double-click on the font to open it and then install). Then restart Matlab.
An example for changing the colorbar and axes font would be:
ax = axes;
c = colorbar;
ax.FontName = 'CMU Serif Extra'; %installation file: cmunsl.ttf
c.FontName = 'CMU Serif Extra';
Related Question