how to do a legend with text, variables, and Greek symbols in it?
    12 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Ainsley
 el 3 de Feb. de 2024
  
    
    
    
    
    Respondida: Dyuman Joshi
      
      
 el 3 de Feb. de 2024
            Im trying to use a legend and display "Trajectory of (Greek symbol Theta naught) = (variable1 in form xx.xxxx)(degree symbol)" , "Trajectory of (Greek symbol Theta naught) = (variable2 in form xx.xxxx)(degree symbol)"
Ive tried using \theta and \deg and am getting nothing, and nothing in my research has indicated I can do a %7.4f or something similar to put the variable in.
is their anyway to do this?
0 comentarios
Respuesta aceptada
  Dyuman Joshi
      
      
 el 3 de Feb. de 2024
        You can use the symbols as provided in the list here for the default interpreter (i.e. tex) - https://in.mathworks.com/help/matlab/ref/text.html#f68-481090_sep_shared-Interpreter
figure
hold on
%some plots
fplot(@sin)
fplot(@cos, 'r')
%random values
x0 = 10*rand(1,2);
%generate the string accordigly
str = compose('Trajectory of \\theta\\circ = %2.4f\\circ', x0);
legend(str)
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Labels and Annotations 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!


