How to write _ in a plot legend?
    47 views (last 30 days)
  
       Show older comments
    
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is 

i want to 'a_b' in legend .......
How to write ??
0 Comments
Accepted Answer
  Cris LaPierre
    
      
 on 4 Feb 2021
        Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
More Answers (2)
  weikang zhao
      
 on 4 Feb 2021
        - change the Interpreter like other answers
- Tex has its own escape for _ :
legend('a\_b');
0 Comments
See Also
Categories
				Find more on Legend 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!



