Disabling printing underscore as subscript in figures
    640 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    AP
      
 el 11 de Jun. de 2011
  
    
    
    
    
    Comentada: Eliot
 el 16 de Abr. de 2025
            Underscores print as subscript in figures. Can I disable it because I want to print the underscores as well.
Thanks.
2 comentarios
  Michael Marcus
      
 el 11 de Abr. de 2019
				
      Editada: Stephen23
      
      
 el 11 de Abr. de 2019
  
			Although this allows underscores to print, it does not allow special symbols such as \mum to work..  Does anyone know how to allow both.
Mike Marcus 
  Michael Marcus
      
 el 11 de Abr. de 2019
				I did find out another way to keep the underscore.  \_  does work ?  I have answered my own question?  Convert all underscores in the text to \_ instead of changing the interpreter to none.
Respuesta aceptada
  Walter Roberson
      
      
 el 11 de Jun. de 2011
        
      Editada: Image Analyst
      
      
 el 17 de En. de 2018
  
      Set the Interpreter property for that field to 'none'; the default for text() fields is LaTex.
title('This_title has an underline', 'Interpreter', 'none'); % Also works with xlabel() and ylabel()
13 comentarios
Más respuestas (1)
  HE
 el 5 de Mayo de 2020
        If you are using sprintf, \\_ should work for you.
Example from https://www.mathworks.com/matlabcentral/answers/94238-how-can-i-place-the-_-or-characters-in-a-text-command#comment_327816:
old_cells = sprintf('Old cells: Y = %3.3f (X) \\^ %1.3f',coefs_old);
young_cells = sprintf('Young cells: Y = %3.3f (X) \\^%1.3f',coefs_young);
0 comentarios
Ver también
Categorías
				Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!









