How to change the font of ticks in a colorbar?
62 ビュー (過去 30 日間)
古いコメントを表示
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 ;)
0 件のコメント
採用された回答
Marc Jakobi
2016 年 10 月 4 日
編集済み: Walter Roberson
2016 年 10 月 8 日
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';
4 件のコメント
その他の回答 (3 件)
Massimo Zanetti
2016 年 10 月 4 日
Set TickLabelInterpreter property to 'latex'
2 件のコメント
Pavaman
2018 年 11 月 6 日
Thanks for this answer. It saved me. I was using the colorbar Label Interpreter property and trying to change that to no avail. the TickLabelInterpreter property was the one I was looking for. An hour of MATLAB answers scouring led me to here.
Mehedi Hassan
2020 年 10 月 28 日
this will set your colorbar ticks to latex font:
c = colorbar;
set(c,'TickLabelInterpreter','latex')
0 件のコメント
Lukas Bathelt
2016 年 10 月 5 日
1 件のコメント
Marc Jakobi
2016 年 10 月 8 日
No problem. If one of the answers solved your problem, would you please accept it as an answer?
参考
カテゴリ
Help Center および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!