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.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM