I want to replace the hyphens with en dashes in a plot axes.
    11 views (last 30 days)
  
       Show older comments
    
    Abdulaziz Abutunis
 on 22 Jun 2022
  
    
    
    
    
    Commented: Walter Roberson
      
      
 on 18 Jan 2025
            Dear all
I need help with replacing the hyphens in the y-axis with en dashes in a plot. In other words, I want to increase the length of the negative sing in the plot axis.
Thanks
Aziz
Accepted Answer
  Jonas
      
 on 22 Jun 2022
        i suggest you have a look into the yticklabels() and xticklabels() and do some replacement of '-' with the en dash char(0x2013).
plot(-10:10);
yticklabels()
yticklabels(replace(yticklabels(),'-',char(0x2013)));
yticklabels()
2 Comments
  Jonas
      
 on 23 Jun 2022
				my pleasure. note that the effect vanishes if the ticks are changed or refreshed. This can also happen e.g. when you resize the figure
More Answers (0)
See Also
Categories
				Find more on Data Exploration in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

