change hyphen (-) to minus sign (−) in matlab

How to put en dashes instead of hyphens for a negative values on the x,y-axis and colorbar numbers? - (mathworks.cn)

Left picture has correct view: en dashes are used on the y-axis negative numbers.
Right picture is what I usually have: hyphens are used on the y-axis negative numbers.
I need to change this in a purpose for the publication, it`s an important note. I checked already everything and didn`t find any info besides the latex interpreter for the text function.

 

ax = gca;
yticklabels(ax, strrep(yticklabels(ax),'--','–'));
set(ax,'ticklabelinterpreter','none') %or 'tex' but not 'latex'

 

my change

ax = gca;
yticklabels(ax, strrep(yticklabels(ax),'-','–'));
set(ax,'ticklabelinterpreter','none') %or 'tex' but not 'latex'

  

The replacement character is the unicode en-dash character, U+2013
Note: the 'none' interpreter and 'tex' interpreter support unicode, but latex interpreter does not.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章