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.
原文地址:https://www.cnblogs.com/gisalameda/p/15692916.html